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
package/dist/api.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { createComponents, createRegistry, isAnyZodType, unwrapZodObject } from "./components-
|
|
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
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponents, createPaths, createRegistry, createSchema } from "./components-
|
|
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 = {}) => {
|