New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@anatine/zod-openapi

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anatine/zod-openapi - npm Package Compare versions

Comparing version 1.14.1 to 1.14.2

2

CHANGELOG.md

@@ -5,2 +5,4 @@ # Changelog

### [1.14.2](https://github.com/anatine/zod-plugins/compare/zod-openapi-1.14.1...zod-openapi-1.14.2) (2023-06-16)
### [1.14.1](https://github.com/anatine/zod-plugins/compare/zod-openapi-1.14.0...zod-openapi-1.14.1) (2023-06-16)

@@ -7,0 +9,0 @@

2

package.json
{
"name": "@anatine/zod-openapi",
"version": "1.14.1",
"version": "1.14.2",
"description": "Zod to OpenAPI converter",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -203,4 +203,19 @@ "use strict";

function parseUnion({ schemas, zodRef, useOutput, }) {
const contents = zodRef._def.options;
if (contents.reduce((prev, content) => prev && content._def.typeName === 'ZodLiteral', true)) {
// special case to transform unions of literals into enums
const literals = contents;
const type = literals
.reduce((prev, content) => !prev || prev === typeof content._def.value ?
typeof content._def.value :
null, null);
if (type) {
return (0, ts_deepmerge_1.default)({
type: type,
enum: literals.map((literal) => literal._def.value)
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
}
}
return (0, ts_deepmerge_1.default)({
oneOf: zodRef._def.options.map((schema) => generateSchema(schema, useOutput)),
oneOf: contents.map((schema) => generateSchema(schema, useOutput)),
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);

@@ -207,0 +222,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