zod-to-json-schema
Advanced tools
Comparing version 3.9.3 to 3.9.4
@@ -5,2 +5,3 @@ # Changelog | ||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| 3.9.4 | Path bug fix and test case when using optional definitions path | ||
| 3.9.3 | Added option to change definition property name to $defs | | ||
@@ -7,0 +8,0 @@ | 3.9.2 | Added option to handle transform results as any instead of relying on their input schema. | |
import { zodToJsonSchema } from "./src/zodToJsonSchema"; | ||
export default zodToJsonSchema; | ||
export { zodToJsonSchema }; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "zod-to-json-schema", | ||
"version": "3.9.3", | ||
"version": "3.9.4", | ||
"description": "Converts Zod schemas to Json Schemas", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ # Zod to Json Schema |
@@ -0,0 +0,0 @@ import { ZodTypeDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
export declare type JsonSchema7AnyType = {}; | ||
export declare function parseAnyDef(): JsonSchema7AnyType; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodArrayDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare type JsonSchema7BigintType = { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare type JsonSchema7BooleanType = { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare type JsonSchema7DateType = { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodDefaultDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodEffectsDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodEnumDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { JSONSchema7Type } from "json-schema"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodLiteralDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodMapDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodNativeEnumDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare type JsonSchema7NeverType = { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare type JsonSchema7NullType = { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodNullableDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodNumberDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodObjectDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodPromiseDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodRecordDef, ZodTypeAny } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodSetDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodStringDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodTupleDef, ZodTupleItems, ZodTypeAny } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare type JsonSchema7UndefinedType = { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodUnionDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
export declare type JsonSchema7UnknownType = {}; | ||
export declare function parseUnknownDef(): JsonSchema7UnknownType; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodTypeDef } from "zod"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ZodSchema } from "zod"; |
@@ -8,3 +8,3 @@ "use strict"; | ||
function zodToJsonSchema(schema, options) { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
if (typeof options === "object") { | ||
@@ -18,3 +18,7 @@ return options.name === undefined | ||
[(_e = options.definitionPath) !== null && _e !== void 0 ? _e : "definitions"]: { | ||
[options.name]: (0, parseDef_1.parseDef)(schema._def, new References_1.References([...((_f = options.basePath) !== null && _f !== void 0 ? _f : []), "definitions", options.name], [], (_g = options.$refStrategy) !== null && _g !== void 0 ? _g : "root", options.effectStrategy)) || {}, | ||
[options.name]: (0, parseDef_1.parseDef)(schema._def, new References_1.References([ | ||
...((_f = options.basePath) !== null && _f !== void 0 ? _f : ["#"]), | ||
(_g = options.definitionPath) !== null && _g !== void 0 ? _g : "definitions", | ||
options.name, | ||
], [], (_h = options.$refStrategy) !== null && _h !== void 0 ? _h : "root", options.effectStrategy)) || {}, | ||
}, | ||
@@ -21,0 +25,0 @@ }; |
Sorry, the diff of this file is not supported yet
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
64
940
0
54344