@anatine/zod-openapi
Advanced tools
Comparing version 1.14.0 to 1.14.1
@@ -5,2 +5,4 @@ # Changelog | ||
### [1.14.1](https://github.com/anatine/zod-plugins/compare/zod-openapi-1.14.0...zod-openapi-1.14.1) (2023-06-16) | ||
## [1.14.0](https://github.com/anatine/zod-plugins/compare/zod-openapi-1.13.0...zod-openapi-1.14.0) (2023-05-23) | ||
@@ -7,0 +9,0 @@ |
{ | ||
"name": "@anatine/zod-openapi", | ||
"version": "1.14.0", | ||
"version": "1.14.1", | ||
"description": "Zod to OpenAPI converter", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
import { z } from "zod"; | ||
import { SchemaObject } from "openapi3-ts"; | ||
import { SchemaObject } from "openapi3-ts/oas31"; | ||
import { ZodTypeDef } from "zod/lib/types"; | ||
@@ -4,0 +4,0 @@ declare module 'zod' { |
@@ -1,2 +0,2 @@ | ||
import type { SchemaObject } from 'openapi3-ts'; | ||
import type { SchemaObject } from 'openapi3-ts/oas31'; | ||
import { ZodTypeAny } from 'zod'; | ||
@@ -3,0 +3,0 @@ export interface OpenApiZodAny extends ZodTypeAny { |
@@ -97,3 +97,3 @@ "use strict"; | ||
if (!item.inclusive) | ||
baseSchema.exclusiveMaximum = true; | ||
baseSchema.exclusiveMaximum = item.value; | ||
break; | ||
@@ -103,3 +103,3 @@ case 'min': | ||
if (!item.inclusive) | ||
baseSchema.exclusiveMinimum = true; | ||
baseSchema.exclusiveMinimum = item.value; | ||
break; | ||
@@ -136,3 +136,3 @@ case 'int': | ||
const required = requiredProperties.length > 0 ? { required: requiredProperties } : {}; | ||
const result = (0, ts_deepmerge_1.default)(Object.assign(Object.assign({ type: 'object', properties: iterateZodObject({ | ||
return (0, ts_deepmerge_1.default)(Object.assign(Object.assign({ type: 'object', properties: iterateZodObject({ | ||
zodRef: zodRef, | ||
@@ -142,3 +142,2 @@ schemas, | ||
}) }, required), additionalProperties), zodRef.description ? { description: zodRef.description } : {}, ...schemas); | ||
return result; | ||
} | ||
@@ -145,0 +144,0 @@ function parseRecord({ zodRef, schemas, useOutput, }) { |
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
39020
336