Skip to content

chore(deps): update dependency zod to ^4.4.2#90

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/zod-4.x
Open

chore(deps): update dependency zod to ^4.4.2#90
renovate[bot] wants to merge 1 commit intomainfrom
renovate/zod-4.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Dec 15, 2025

This PR contains the following updates:

Package Change Age Confidence
zod (source) ^4.1.13^4.4.2 age confidence

Release Notes

colinhacks/zod (zod)

v4.4.2

Compare Source

v4.4.1

Compare Source

v4.4.0

Compare Source

v4.3.6

Compare Source

Commits:

v4.3.5

Compare Source

Commits:

v4.3.4

Compare Source

Commits:

v4.3.3

Compare Source

v4.3.2

Compare Source

v4.3.1

Compare Source

Commits:

  • 0fe8840 allow non-overwriting extends with refinements. 4.3.1

v4.3.0

Compare Source

This is Zod's biggest release since 4.0. It addresses several of Zod's longest-standing feature requests.

z.fromJSONSchema()

Convert JSON Schema to Zod (#​5534, #​5586)

You can now convert JSON Schema definitions directly into Zod schemas. This function supports JSON Schema "draft-2020-12", "draft-7", "draft-4", and OpenAPI 3.0.

import * as z from "zod";

const schema = z.fromJSONSchema({
  type: "object",
  properties: {
    name: { type: "string", minLength: 1 },
    age: { type: "integer", minimum: 0 },
  },
  required: ["name"],
});

schema.parse({ name: "Alice", age: 30 }); // ✅

The API should be considered experimental. There are no guarantees of 1:1 "round-trip soundness": MySchema > z.toJSONSchema() > z.fromJSONSchema(). There are several features of Zod that don't exist in JSON Schema and vice versa, which makes this virtually impossible.

Features supported:

  • All primitive types (string, number, integer, boolean, null, object, array)
  • String formats (email, uri, uuid, date-time, date, time, ipv4, ipv6, and more)
  • Composition (anyOf, oneOf, allOf)
  • Object constraints (additionalProperties, patternProperties, propertyNames)
  • Array constraints (prefixItems, items, minItems, maxItems)
  • $ref for local references and circular schemas
  • Custom metadata is preserved

z.xor() — exclusive union (#​5534)

A new exclusive union type that requires exactly one option to match. Unlike z.union() which passes if any option matches, z.xor() fails if zero or more than one option matches.

const schema = z.xor([z.string(), z.number()]);

schema.parse("hello"); // ✅
schema.parse(42);      // ✅
schema.parse(true);    // ❌ zero matches

When converted to JSON Schema, z.xor() produces oneOf instead of anyOf.

z.looseRecord() — partial record validation (#​5534)

A new record variant that only validates keys matching the key schema, passing through non-matching keys unchanged. This is used to represent patternProperties in JSON Schema.

const schema = z.looseRecord(z.string().regex(/^S_/), z.string());

schema.parse({ S_name: "John", other: 123 });
// ✅ { S_name: "John", other: 123 }
// only S_name is validated, "other" passes through

.exactOptional() — strict optional properties (#​5589)

A new wrapper that makes a property key-optional (can be omitted) but does not accept undefined as an explicit value.

const schema = z.object({
  a: z.string().optional(),      // accepts `undefined`
  b: z.string().exactOptional(), // does not accept `undefined`
});

schema.parse({});                  // ✅
schema.parse({ a: undefined });    // ✅
schema.parse({ b: undefined });    // ❌

This makes it possible to accurately represent the full spectrum of optionality expressible using exactOptionalPropertyTypes.

.apply()

A utility method for applying arbitrary transformations to a schema, enabling cleaner schema composition. (#​5463)

const setCommonChecks = <T extends z.ZodNumber>(schema: T) => {
  return schema.min(0).max(100);
};

const schema = z.number().apply(setCommonChecks).nullable();

.brand() cardinality

The .brand() method now accepts a second argument to control whether the brand applies to input, output, or both. Closes #​4764, #​4836.

// output only (default)
z.string().brand<"UserId">();           // output is branded (default)
z.string().brand<"UserId", "out">();    // output is branded
z.string().brand<"UserId", "in">();     // input is branded
z.string().brand<"UserId", "inout">();  // both are branded

Type predicates on .refine() (#​5575)

The .refine() method now supports type predicates to narrow the output type:

const schema = z.string().refine((s): s is "a" => s === "a");

type Input = z.input<typeof schema>;   // string
type Output = z.output<typeof schema>; // "a"

ZodMap methods: min, max, nonempty, size (#​5316)

ZodMap now has parity with ZodSet and ZodArray:

const schema = z.map(z.string(), z.number())
  .min(1)
  .max(10)
  .nonempty();

schema.size; // access the size constraint

.with() alias for .check() (359c0db)

A new .with() method has been added as a more readable alias for .check(). Over time, more APIs have been added that don't qualify as "checks". The new method provides a readable alternative that doesn't muddy semantics.

z.string().with(
  z.minLength(5),
  z.toLowerCase()
);

// equivalent to:
z.string().check(
  z.minLength(5),
  z.trim(),
  z.toLowerCase()
);
z.slugify() transform

Transform strings into URL-friendly slugs. Works great with .with():

// Zod
z.string().slugify().parse("Hello World");           // "hello-world"

// Zod Mini
// using .with() for explicit check composition
z.string().with(z.slugify()).parse("Hello World");   // "hello-world"

z.meta() and z.describe() in Zod Mini (947b4eb)

Zod Mini now exports z.meta() and z.describe() as top-level functions for adding metadata to schemas:

import * as z from "zod/mini";

// add description
const schema = z.string().with(
  z.describe("A user's name"),
);

// add arbitrary metadata
const schema2 = z.number().with(
  z.meta({ deprecated: true })
);

New locales

import * as z from "zod";
import { uz } from "zod/locales";

z.config(uz());






Bug fixes

All of these changes fix soundness issues in Zod. As with any bug fix there's some chance of breakage if you were intentionally or unintentionally relying on this unsound behavior.

⚠️ .pick() and .omit() disallowed on object schemas containing refinements (#​5317)

Using .pick() or .omit() on object schemas with refinements now throws an error. Previously, this would silently drop the refinements, leading to unexpected behavior.

const schema = z.object({
  password: z.string(),
  confirmPassword: z.string(),
}).refine(data => data.password === data.confirmPassword);

schema.pick({ password: true });
// 4.2: refinement silently dropped ⚠️
// 4.3: throws error ❌

Migration: The easiest way to migrate is to create a new schema using the shape of the old one.

const newSchema = z.object(schema.shape).pick({ ... })
⚠️ .extend() disallowed on refined schemas (#​5317)

Similarly, .extend() now throws on schemas with refinements. Use .safeExtend() if you need to extend refined schemas.

const schema = z.object({ a: z.string() }).refine(/* ... */);

// 4.2: refinement silently dropped ⚠️
// 4.3: throws error ✅
schema.extend({ b: z.number() });
// error: object schemas containing refinements cannot be extended. use `.safeExtend()` instead.
⚠️ Stricter object masking methods (#​5581)

Object masking methods (.pick(), .omit()) now validate that the keys provided actually exist in the schema:

const schema = z.object({ a: z.string() });

// 4.3: throws error for unrecognized keys
schema.pick({ nonexistent: true });
// error: unrecognized key: "nonexistent"

Additional changes

  • Fixed JSON Schema generation for z.iso.time with minute precision (#​5557)
  • Fixed error details for tuples with extraneous elements (#​5555)
  • Fixed includes method params typing to accept string | $ZodCheckIncludesParams (#​5556)
  • Fixed numeric formats error messages to be inclusive (#​5485)
  • Fixed implementAsync inferred type to always be a promise (#​5476)
  • Tightened E.164 regex to require a non-zero leading digit and 7–15 digits total (#​5524)
  • Fixed Dutch (nl) error strings (#​5529)
  • Convert Date instances to numbers in minimum/maximum checks (#​5351)
  • Improved numeric keys handling in z.record() (#​5585)
  • Lazy initialization of ~standard schema property (#​5363)
  • Functions marked as @__NO_SIDE_EFFECTS__ for better tree-shaking (#​5475)
  • Improved metadata tracking across child-parent relationships (#​5578)
  • Improved locale translation approach (#​5584)
  • Dropped id uniqueness enforcement at registry level (#​5574)

v4.2.1

Compare Source

v4.2.0

Compare Source

Features

Implement Standard JSON Schema

standard-schema/standard-schema#134

Implement z.fromJSONSchema()
const jsonSchema = {
  type: "object",
  properties: {
    name: { type: "string" },
    age: { type: "number" }
  },
  required: ["name"]
};

const schema = z.fromJSONSchema(jsonSchema);
Implement z.xor()
const schema = z.xor(
  z.object({ type: "user", name: z.string() }),
  z.object({ type: "admin", role: z.string() })
);
// Exactly one of the schemas must match
Implement z.looseRecord()
const schema = z.looseRecord(z.string(), z.number());
// Allows additional properties beyond those defined

Commits:


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/zod-4.x branch from 91deea3 to 2302d6e Compare December 16, 2025 04:40
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.2.0 chore(deps): update dependency zod to ^4.2.1 Dec 16, 2025
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from 2302d6e to 7c5f959 Compare December 31, 2025 05:46
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.2.1 chore(deps): update dependency zod to ^4.3.0 Dec 31, 2025
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from 7c5f959 to e66db7a Compare December 31, 2025 09:29
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.3.0 chore(deps): update dependency zod to ^4.3.2 Dec 31, 2025
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from e66db7a to 35dc75c Compare December 31, 2025 21:50
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.3.2 chore(deps): update dependency zod to ^4.3.3 Dec 31, 2025
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from 35dc75c to 53a2ea0 Compare January 1, 2026 04:41
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.3.3 chore(deps): update dependency zod to ^4.3.4 Jan 1, 2026
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from 53a2ea0 to fc81276 Compare January 4, 2026 09:14
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.3.4 chore(deps): update dependency zod to ^4.3.5 Jan 4, 2026
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from fc81276 to fd96c6a Compare January 8, 2026 20:36
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from fd96c6a to b6704f7 Compare January 23, 2026 16:02
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.3.5 chore(deps): update dependency zod to ^4.3.6 Jan 23, 2026
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from b6704f7 to 76bb290 Compare February 2, 2026 20:31
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from 76bb290 to ed7d3d1 Compare April 29, 2026 22:58
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.3.6 chore(deps): update dependency zod to ^4.4.0 Apr 29, 2026
@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Apr 29, 2026

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: pnpm-lock.yaml
Progress: resolved 1, reused 0, downloaded 0, added 0
 ERR_PNPM_NO_MATURE_MATCHING_VERSION  Version 4.4.2 (released 3 hours ago) of zod does not meet the minimumReleaseAge constraint

This error happened while installing a direct dependency of /tmp/renovate/repos/github/InformaticsMatters/squonk2-openapi-js-client-generator

The latest release of zod is "4.4.2". Published at 5/1/2026 9:30:03 PM

Other releases are:
  * next: 3.25.0-beta.20250519T094321 published at 5/19/2025
  * alpha: 3.25.68-alpha.11 published at 6/24/2025
  * beta: 4.1.13-beta.0 published at 10/15/2025
  * canary: 4.5.0-canary.20260430T040905 published at 4/30/2026

If you need the full list of all 868 published versions run "pnpm view zod versions".

If you want to install the matched version ignoring the time it was published, you can add the package name to the minimumReleaseAgeExclude setting. Read more about it: https://pnpm.io/settings#minimumreleaseageexclude

@renovate renovate Bot force-pushed the renovate/zod-4.x branch from ed7d3d1 to 0eed5e7 Compare April 30, 2026 06:04
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.4.0 chore(deps): update dependency zod to ^4.4.1 Apr 30, 2026
@renovate renovate Bot force-pushed the renovate/zod-4.x branch from 0eed5e7 to cba51f4 Compare May 2, 2026 00:49
@renovate renovate Bot changed the title chore(deps): update dependency zod to ^4.4.1 chore(deps): update dependency zod to ^4.4.2 May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants