Skip to content

Commit f60de9a

Browse files
committed
Revert undefined json schema changes
1 parent 39c5f71 commit f60de9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/zod/src/v4/core/to-json-schema.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ export class JSONSchemaGenerator {
227227
case "unknown": {
228228
break;
229229
}
230-
case "undefined":
230+
case "undefined": {
231+
const json = _json as JSONSchema.NullSchema;
232+
json.type = "null";
233+
break;
234+
}
231235
case "never": {
232236
_json.not = {};
233237
break;

0 commit comments

Comments
 (0)