Zod Version 4.3.3
Zod 4.3.3 ist ein Versions-Release, dessen Notes nur den Versions-Commit nennen.
Commits:
- f3b2151959d215d405f54dff3c7ab3bf1fd887ca v4.3.3
Folge Zod, um die Release Notes in deinen Feed zu holen.
Zod 4.3.3 ist ein Versions-Release, dessen Notes nur den Versions-Commit nennen.
Zod 4.3.2 lockert strictObject innerhalb einer Intersection.
Zod 4.3.1 erlaubt nicht überschreibendes extends bei Schemas mit Refinements.
Zod 4.3.0 führt mit z.fromJSONSchema() die experimentelle Umwandlung von JSON Schema (draft-2020-12, draft-7, draft-4, OpenAPI 3.0) in Zod-Schemas ein.
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:
string, number, integer, boolean, null, object, array)email, uri, uuid, date-time, date, time, ipv4, ipv6, and more)anyOf, oneOf, allOf)additionalProperties, patternProperties, propertyNames)prefixItems, items, minItems, maxItems)$ref for local references and circular schemas …Zod 4.2.1 ist ein Versions-Release, dessen Notes nur den Versions-Commit nennen.
Zod 4.2.0 implementiert Standard JSON Schema und ergänzt z.fromJSONSchema(), z.xor(), z.looseRecord() sowie eine .toJSONSchema()-Methode.
https://github.com/standard-schema/standard-schema/pull/134
z.fromJSONSchema()const jsonSchema = {
type: "object",
properties: {
name: { type: "string" },
age: { type: "number" }
},
required: ["name"]
};
const schema = z.fromJSONSchema(jsonSchema);
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
z.looseRecord()const schema = z.looseRecord(z.string(), z.number());
// Allows additional properties beyond those defined
z.undefined() (#5504).toJSONSchema() method (#5477)z.fromJSONSchema(), z.looseRecord(), z.xor() (#5534)Zod 4.1.13 bringt schnellere Initialisierung, eine korrekte Darstellung des angegebenen Regex in Fehlermeldungen, einen Fix für partielle Records, verbesserte niederländische Lokalisierung und Anpassungen am inferierten z.promise()-Typ.
Zod 4.1.12 behebt einen Absturz von flatten() bei einem 'toString'-Schlüssel in ZodError, vereinheitlicht die Fehlerstruktur und ergänzt Dokumentation.
eslint-plugin-zod-x (#5261)Zod 4.1.11 enthält laut Eintrag lediglich den Versionsstand-Commit ohne weitere beschriebene Änderungen.
Zod 4.1.10 behebt ein Problem beim Caching von Shapes.
Zod 4.1.9 aktualisiert die Build-Abhängigkeit zshy.
Zod 4.1.8 wechselt wieder zurück zu WeakMap.