zod-openapi 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js CHANGED
@@ -1,4 +1,4 @@
1
- const require_components = require('./components-C0rn1JRo.js');
1
+ const require_components = require('./components-Dvp0Kklk.js');
2
2
 
3
3
  exports.createComponents = require_components.createComponents;
4
4
  exports.createRegistry = require_components.createRegistry;
package/dist/api.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { createComponents, createRegistry, isAnyZodType, unwrapZodObject } from "./components-Ci7Vy4JN.mjs";
1
+ import { createComponents, createRegistry, isAnyZodType, unwrapZodObject } from "./components-0wA88nKJ.mjs";
2
2
 
3
3
  export { createComponents, createRegistry, isAnyZodType, unwrapZodObject };
@@ -246,6 +246,13 @@ const validate = (ctx, opts) => {
246
246
  const allowEmptySchema = opts.allowEmptySchema?.[def.type];
247
247
  if (allowEmptySchema === true || allowEmptySchema?.[ctx.io]) return;
248
248
  switch (def.type) {
249
+ case "optional": {
250
+ validate({
251
+ ...ctx,
252
+ zodSchema: def.innerType
253
+ }, opts);
254
+ return;
255
+ }
249
256
  case "any": return;
250
257
  case "unknown": return;
251
258
  case "pipe": {
@@ -269,6 +269,13 @@ const validate = (ctx, opts) => {
269
269
  const allowEmptySchema = opts.allowEmptySchema?.[def.type];
270
270
  if (allowEmptySchema === true || allowEmptySchema?.[ctx.io]) return;
271
271
  switch (def.type) {
272
+ case "optional": {
273
+ validate({
274
+ ...ctx,
275
+ zodSchema: def.innerType
276
+ }, opts);
277
+ return;
278
+ }
272
279
  case "any": return;
273
280
  case "unknown": return;
274
281
  case "pipe": {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const require_components = require('./components-C0rn1JRo.js');
1
+ const require_components = require('./components-Dvp0Kklk.js');
2
2
 
3
3
  //#region src/create/document.ts
4
4
  const createDocument = (zodOpenApiObject, opts = {}) => {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createComponents, createPaths, createRegistry, createSchema } from "./components-Ci7Vy4JN.mjs";
1
+ import { createComponents, createPaths, createRegistry, createSchema } from "./components-0wA88nKJ.mjs";
2
2
 
3
3
  //#region src/create/document.ts
4
4
  const createDocument = (zodOpenApiObject, opts = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod-openapi",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Convert Zod Schemas to OpenAPI v3.x documentation",
5
5
  "keywords": [
6
6
  "typescript",