@anatine/zod-openapi
Advanced tools
Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "@anatine/zod-openapi", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Zod to OpenAPI converter", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -74,3 +74,3 @@ # @anatine/zod-openapi | ||
```typescript | ||
import { generateSchema } from '@anatine/zod-openapi'; | ||
import { extendApi, generateSchema } from '@anatine/zod-openapi'; | ||
@@ -153,2 +153,2 @@ const aZodExtendedSchema = extendApi( | ||
This library is part of a nx monorepo [@anatine/zod-plugins](https://github.com/anatine/zod-plugins). | ||
This library is part of a nx monorepo [@anatine/zod-plugins](https://github.com/anatine/zod-plugins). |
@@ -107,5 +107,7 @@ "use strict"; | ||
function parseObject({ zodRef, schemas, useOutput, }) { | ||
var _a; | ||
let additionalProperties; | ||
// `catchall` obviates `strict`, `strip`, and `passthrough` | ||
if (!(zodRef._def.catchall instanceof zod_1.z.ZodNever)) | ||
if (!(zodRef._def.catchall instanceof zod_1.z.ZodNever || | ||
((_a = zodRef._def.catchall) === null || _a === void 0 ? void 0 : _a._def.typeName) === 'ZodNever')) | ||
additionalProperties = generateSchema(zodRef._def.catchall, useOutput); | ||
@@ -122,4 +124,6 @@ else if (zodRef._def.unknownKeys === 'passthrough') | ||
const item = zodRef.shape[key]; | ||
return (!(item.isOptional() || item instanceof zod_1.z.ZodDefault) && | ||
!(item instanceof zod_1.z.ZodNever)); | ||
return (!(item.isOptional() || | ||
item instanceof zod_1.z.ZodDefault || | ||
item._def.typeName === 'ZodDefault') && | ||
!(item instanceof zod_1.z.ZodNever || item._def.typeName === 'ZodDefault')); | ||
}) }, additionalProperties), ...schemas); | ||
@@ -126,0 +130,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
23292
272
153