Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zod-to-json-schema

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zod-to-json-schema - npm Package Compare versions

Comparing version 3.21.2 to 3.21.3

3

changelog.md

@@ -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;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc