You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,53 @@ try {
87
87
}
88
88
```
89
89
90
+
## API Reference
91
+
92
+
### `convertJsonSchemaToZod(schema)`
93
+
94
+
Converts a JSON Schema object to a complete Zod schema.
95
+
96
+
-**Parameters**:
97
+
-`schema` (Object): A JSON Schema object
98
+
-**Returns**:
99
+
- A Zod schema that validates according to the JSON Schema
100
+
101
+
### `jsonSchemaObjectToZodRawShape(schema)`
102
+
103
+
Extracts the object properties from a JSON Schema object into a Zod raw shape. This is useful when you want to combine the properties with other Zod object configurations.
104
+
105
+
-**Parameters**:
106
+
-`schema` (Object): A JSON Schema object that should have a `properties` field
107
+
-**Returns**:
108
+
- A `ZodRawShape` object that can be used with `z.object()`
0 commit comments