zod-to-json-schema
Advanced tools
Comparing version 3.21.2 to 3.21.3
@@ -5,3 +5,4 @@ # Changelog | ||
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| 3.21.2 | Adds "integer" type Date output to support min/max checks, markdownDescription option, fixes "none" refStrategy by adding "seen" and adds an option to use "pattern" with Zods' email enum instead of "format". | | ||
| 3.21.3 | Fixes issue #77 (Reference path to nullable schemas in Open-API mode) | | ||
| 3.21.2 | Adds "integer" type Date output to support min/max checks, markdownDescription option, fixes "none" refStrategy by adding "seen" and adds an option to use "pattern" with Zods' email enum instead of "format". | | ||
| 3.21.1 | New target (2019-09) along with improved intersection schemas, improved mutual recursion references in definitions, descriptions respected in union parser and not removed in collapsed | | ||
@@ -8,0 +9,0 @@ | 3.21.0 | Added new string validations (ip, emoji, etc) and BigInt checks to support Zod 3.21 | |
{ | ||
"name": "zod-to-json-schema", | ||
"version": "3.21.2", | ||
"version": "3.21.3", | ||
"description": "Converts Zod schemas to Json Schemas", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,16 +22,9 @@ "use strict"; | ||
} | ||
const type = (0, parseDef_1.parseDef)(def.innerType._def, Object.assign(Object.assign({}, refs), { currentPath: [...refs.currentPath, "anyOf", "0"] })); | ||
return type | ||
? refs.target === "openApi3" | ||
? Object.assign(Object.assign({}, type), { nullable: true }) | ||
: { | ||
anyOf: [ | ||
type, | ||
{ | ||
type: "null", | ||
}, | ||
], | ||
} | ||
: undefined; | ||
if (refs.target === "openApi3") { | ||
const base = (0, parseDef_1.parseDef)(def.innerType._def, Object.assign(Object.assign({}, refs), { currentPath: [...refs.currentPath] })); | ||
return base && Object.assign(Object.assign({}, base), { nullable: true }); | ||
} | ||
const base = (0, parseDef_1.parseDef)(def.innerType._def, Object.assign(Object.assign({}, refs), { currentPath: [...refs.currentPath, "anyOf", "0"] })); | ||
return base && { anyOf: [base, { type: "null" }] }; | ||
} | ||
exports.parseNullableDef = parseNullableDef; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106227
1490