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.9.3 to 3.9.4

lab.d.ts

1

changelog.md

@@ -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";

2

package.json
{
"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

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