File tree Expand file tree Collapse file tree 5 files changed +12
-86
lines changed Expand file tree Collapse file tree 5 files changed +12
-86
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ A library that creates [Zod](https://github.com/colinhacks/zod) types from [JSON
1111npm install zod-from-json-schema
1212```
1313
14+ ## Zod 3 vs 4
15+
16+ - If you need Zod 4, use the latest version of this package.
17+ - If you need Zod 3, use the latest version that's less than 0.4.0 (at the of writing that's 0.0.5)
18+
1419## Usage
1520
1621This package supports both ESM and CommonJS formats.
@@ -96,7 +101,7 @@ Converts a JSON Schema object to a complete Zod schema.
96101
97102- ** Parameters** :
98103 - ` schema ` (Object): A JSON Schema object
99- - ** Returns** :
104+ - ** Returns** :
100105 - A Zod schema that validates according to the JSON Schema
101106
102107### ` jsonSchemaObjectToZodRawShape(schema) `
@@ -105,7 +110,7 @@ Extracts the object properties from a JSON Schema object into a Zod raw shape. T
105110
106111- ** Parameters** :
107112 - ` schema ` (Object): A JSON Schema object that should have a ` properties ` field
108- - ** Returns** :
113+ - ** Returns** :
109114 - A ` ZodRawShape ` object that can be used with ` z.object() `
110115
111116** Example** :
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33 "private" : true ,
44 "type" : " module" ,
55 "scripts" : {
6- "cjs" : " node cjs-example.js " ,
7- "esm" : " node esm-example.js "
6+ "cjs" : " node cjs-example.cjs " ,
7+ "esm" : " node esm-example.mjs "
88 },
99 "dependencies" : {
10- "zod" : " ^3.24.2 " ,
10+ "zod" : " ^3.25.25 " ,
1111 "zod-from-json-schema" : " file:.."
1212 }
13- }
13+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " zod-from-json-schema" ,
3- "version" : " 0.0.5 " ,
3+ "version" : " 0.4.0 " ,
44 "description" : " Creates Zod types from JSON Schema at runtime" ,
55 "main" : " dist/index.js" ,
66 "module" : " dist/index.mjs" ,
You can’t perform that action at this time.
0 commit comments