zod-openapi 5.4.3 → 5.4.5
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.cjs +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/{api.d.ts → api.d.mts} +1 -1
- package/dist/api.mjs +3 -0
- package/dist/{components-JnL0iOr_.d.cts → components-B1DX_zYv.d.mts} +1 -1
- package/dist/{components-CXzxKPFp.d.ts → components-D3KCJ9k6.d.cts} +1 -1
- package/dist/{components-DV_-zLJ6.js → components-WUsO5AOL.mjs} +13 -13
- package/dist/{components-BtkBk4ss.cjs → components-fd4LXedu.cjs} +12 -37
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/{index.d.ts → index.d.mts} +1 -1
- package/dist/{index.js → index.mjs} +2 -2
- package/package.json +8 -8
- package/dist/api.js +0 -3
package/dist/api.cjs
CHANGED
package/dist/api.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as ZodOpenApiBaseMetadata, F as ZodOpenApiOverrideMetaContext, M as ZodOpenApiOverride, N as ZodOpenApiOverrideContext, P as ZodOpenApiOverrideMeta, j as ZodOpenApiMetadata, n as createComponents, r as createRegistry, t as ComponentRegistry } from "./components-D3KCJ9k6.cjs";
|
|
2
2
|
import * as core from "zod/v4/core";
|
|
3
3
|
import { $ZodObject, $ZodType, $ZodTypes } from "zod/v4/core";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as ZodOpenApiBaseMetadata, F as ZodOpenApiOverrideMetaContext, M as ZodOpenApiOverride, N as ZodOpenApiOverrideContext, P as ZodOpenApiOverrideMeta, j as ZodOpenApiMetadata, n as createComponents, r as createRegistry, t as ComponentRegistry } from "./components-B1DX_zYv.mjs";
|
|
2
2
|
import * as core from "zod/v4/core";
|
|
3
3
|
import { $ZodObject, $ZodType, $ZodTypes } from "zod/v4/core";
|
|
4
4
|
|
package/dist/api.mjs
ADDED
|
@@ -632,4 +632,4 @@ interface ComponentRegistry {
|
|
|
632
632
|
declare const createRegistry: (components?: ZodOpenApiComponentsObject) => ComponentRegistry;
|
|
633
633
|
declare const createComponents: (registry: ComponentRegistry, opts: CreateDocumentOptions, openapiVersion?: OpenApiVersion) => ComponentsObject;
|
|
634
634
|
//#endregion
|
|
635
|
-
export {
|
|
635
|
+
export { LinkParametersObject as $, ZodOpenApiBaseMetadata as A, OpenApiVersion as At, ContactObject as B, ZodOpenApiRequestBodyObject as C, TagObject as Ct, ZodOpenApiSecuritySchemeObject as D, IExtensionName as Dt, ZodOpenApiSchemaObject as E, ServerVariableObject as Et, ZodOpenApiOverrideMetaContext as F, ExampleObject as G, DiscriminatorObject as H, BaseParameterObject as I, HeaderObject as J, ExamplesObject as K, CallbackObject as L, ZodOpenApiOverride as M, ZodOpenApiOverrideContext as N, ZodOpenApiVersion as O, IExtensionType as Ot, ZodOpenApiOverrideMeta as P, LinkObject as Q, CallbacksObject as R, ZodOpenApiPathsObject as S, SecuritySchemeType as St, ZodOpenApiResponsesObject as T, ServerObject as Tt, EncodingObject as U, ContentObject as V, EncodingPropertyObject as W, InfoObject as X, HeadersObject as Y, LicenseObject as Z, ZodOpenApiObject as _, SchemaObjectType as _t, ZodObjectInput as a, OperationObject as at, ZodOpenApiParameters as b, SecurityRequirementObject as bt, ZodOpenApiComponentsObject as c, ParameterStyle as ct, ZodOpenApiExamplesObject as d, PathsObject as dt, LinksObject as et, ZodOpenApiHeaderObject as f, ReferenceObject as ft, ZodOpenApiMediaTypeObject as g, SchemaObject as gt, ZodOpenApiLinksObject as h, ResponsesObject as ht, CreateDocumentOptions as i, OpenAPIObject as it, ZodOpenApiMetadata as j, createDocument as k, ISpecificationExtension as kt, ZodOpenApiContentObject as l, PathItemObject as lt, ZodOpenApiLinkObject as m, ResponseObject as mt, createComponents as n, OAuthFlowObject as nt, ZodOpenApiCallbackObject as o, ParameterLocation as ot, ZodOpenApiHeadersObject as p, RequestBodyObject as pt, ExternalDocumentationObject as q, createRegistry as r, OAuthFlowsObject as rt, ZodOpenApiCallbacksObject as s, ParameterObject as st, ComponentRegistry as t, MediaTypeObject as tt, ZodOpenApiExampleObject as u, PathObject as ut, ZodOpenApiOperationObject as v, SchemasObject as vt, ZodOpenApiResponseObject as w, XmlObject as wt, ZodOpenApiPathItemObject as x, SecuritySchemeObject as xt, ZodOpenApiParameterObject as y, ScopesObject as yt, ComponentsObject as z };
|
|
@@ -632,4 +632,4 @@ interface ComponentRegistry {
|
|
|
632
632
|
declare const createRegistry: (components?: ZodOpenApiComponentsObject) => ComponentRegistry;
|
|
633
633
|
declare const createComponents: (registry: ComponentRegistry, opts: CreateDocumentOptions, openapiVersion?: OpenApiVersion) => ComponentsObject;
|
|
634
634
|
//#endregion
|
|
635
|
-
export {
|
|
635
|
+
export { LinkParametersObject as $, ZodOpenApiBaseMetadata as A, OpenApiVersion as At, ContactObject as B, ZodOpenApiRequestBodyObject as C, TagObject as Ct, ZodOpenApiSecuritySchemeObject as D, IExtensionName as Dt, ZodOpenApiSchemaObject as E, ServerVariableObject as Et, ZodOpenApiOverrideMetaContext as F, ExampleObject as G, DiscriminatorObject as H, BaseParameterObject as I, HeaderObject as J, ExamplesObject as K, CallbackObject as L, ZodOpenApiOverride as M, ZodOpenApiOverrideContext as N, ZodOpenApiVersion as O, IExtensionType as Ot, ZodOpenApiOverrideMeta as P, LinkObject as Q, CallbacksObject as R, ZodOpenApiPathsObject as S, SecuritySchemeType as St, ZodOpenApiResponsesObject as T, ServerObject as Tt, EncodingObject as U, ContentObject as V, EncodingPropertyObject as W, InfoObject as X, HeadersObject as Y, LicenseObject as Z, ZodOpenApiObject as _, SchemaObjectType as _t, ZodObjectInput as a, OperationObject as at, ZodOpenApiParameters as b, SecurityRequirementObject as bt, ZodOpenApiComponentsObject as c, ParameterStyle as ct, ZodOpenApiExamplesObject as d, PathsObject as dt, LinksObject as et, ZodOpenApiHeaderObject as f, ReferenceObject as ft, ZodOpenApiMediaTypeObject as g, SchemaObject as gt, ZodOpenApiLinksObject as h, ResponsesObject as ht, CreateDocumentOptions as i, OpenAPIObject as it, ZodOpenApiMetadata as j, createDocument as k, ISpecificationExtension as kt, ZodOpenApiContentObject as l, PathItemObject as lt, ZodOpenApiLinkObject as m, ResponseObject as mt, createComponents as n, OAuthFlowObject as nt, ZodOpenApiCallbackObject as o, ParameterLocation as ot, ZodOpenApiHeadersObject as p, RequestBodyObject as pt, ExternalDocumentationObject as q, createRegistry as r, OAuthFlowsObject as rt, ZodOpenApiCallbacksObject as s, ParameterObject as st, ComponentRegistry as t, MediaTypeObject as tt, ZodOpenApiExampleObject as u, PathObject as ut, ZodOpenApiOperationObject as v, SchemasObject as vt, ZodOpenApiResponseObject as w, XmlObject as wt, ZodOpenApiPathItemObject as x, SecuritySchemeObject as xt, ZodOpenApiParameterObject as y, ScopesObject as yt, ComponentsObject as z };
|
|
@@ -16,7 +16,7 @@ const createExamples = (examples, registry$1, path) => {
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/create/content.ts
|
|
18
18
|
const createMediaTypeObject = (mediaType, ctx, path) => {
|
|
19
|
-
const { schema, examples
|
|
19
|
+
const { schema, examples, ...rest } = mediaType;
|
|
20
20
|
const mediaTypeObject = rest;
|
|
21
21
|
if (isAnyZodType(schema)) mediaTypeObject.schema = ctx.registry.addSchema(schema, [...path, "schema"], {
|
|
22
22
|
io: ctx.io,
|
|
@@ -149,7 +149,7 @@ const createResponses = (responses, registry$1, path) => {
|
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/create/paths.ts
|
|
151
151
|
const createOperation = (operation, registry$1, path) => {
|
|
152
|
-
const { parameters, requestParams, requestBody, responses, callbacks
|
|
152
|
+
const { parameters, requestParams, requestBody, responses, callbacks, ...rest } = operation;
|
|
153
153
|
const operationObject = rest;
|
|
154
154
|
const maybeManualParameters = createManualParameters(parameters, registry$1, [...path, "parameters"]);
|
|
155
155
|
const maybeRequestParams = createParameters(requestParams, registry$1, [...path, "requestParams"]);
|
|
@@ -198,7 +198,7 @@ const override = (ctx) => {
|
|
|
198
198
|
break;
|
|
199
199
|
case "union": {
|
|
200
200
|
if ("discriminator" in def && typeof def.discriminator === "string") {
|
|
201
|
-
ctx.jsonSchema.oneOf
|
|
201
|
+
ctx.jsonSchema.oneOf ??= ctx.jsonSchema.anyOf;
|
|
202
202
|
delete ctx.jsonSchema.anyOf;
|
|
203
203
|
ctx.jsonSchema.type = "object";
|
|
204
204
|
ctx.jsonSchema.discriminator = { propertyName: def.discriminator };
|
|
@@ -537,7 +537,7 @@ const createRegistry = (components) => {
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
});
|
|
540
|
-
const { id: metaId, examples
|
|
540
|
+
const { id: metaId, examples, ...rest } = meta?.param ?? {};
|
|
541
541
|
const parameterObject = {
|
|
542
542
|
in: inLocation,
|
|
543
543
|
name,
|
|
@@ -570,7 +570,7 @@ const createRegistry = (components) => {
|
|
|
570
570
|
const seenHeader = registry$1.components.headers.seen.get(header);
|
|
571
571
|
if (seenHeader) return seenHeader;
|
|
572
572
|
const meta = globalRegistry.get(header);
|
|
573
|
-
const { id: metaId
|
|
573
|
+
const { id: metaId, ...rest } = meta?.header ?? {};
|
|
574
574
|
const id = metaId ?? opts?.manualId;
|
|
575
575
|
const headerObject = rest;
|
|
576
576
|
if (isRequired(header, "output")) headerObject.required = true;
|
|
@@ -593,7 +593,7 @@ const createRegistry = (components) => {
|
|
|
593
593
|
addRequestBody: (requestBody, path, opts) => {
|
|
594
594
|
const seenRequestBody = registry$1.components.requestBodies.seen.get(requestBody);
|
|
595
595
|
if (seenRequestBody) return seenRequestBody;
|
|
596
|
-
const { content, id: metaId
|
|
596
|
+
const { content, id: metaId, ...rest } = requestBody;
|
|
597
597
|
const requestBodyObject = {
|
|
598
598
|
...rest,
|
|
599
599
|
content: createContent(content, {
|
|
@@ -617,7 +617,7 @@ const createRegistry = (components) => {
|
|
|
617
617
|
const seenPathItem = registry$1.components.pathItems.seen.get(pathItem);
|
|
618
618
|
if (seenPathItem) return seenPathItem;
|
|
619
619
|
const pathItemObject = {};
|
|
620
|
-
const { id: metaId
|
|
620
|
+
const { id: metaId, ...rest } = pathItem;
|
|
621
621
|
const id = metaId ?? opts?.manualId;
|
|
622
622
|
for (const [key, value] of Object.entries(rest)) {
|
|
623
623
|
if (isISpecificationExtension(key)) {
|
|
@@ -648,7 +648,7 @@ const createRegistry = (components) => {
|
|
|
648
648
|
addResponse: (response, path, opts) => {
|
|
649
649
|
const seenResponse = registry$1.components.responses.seen.get(response);
|
|
650
650
|
if (seenResponse) return seenResponse;
|
|
651
|
-
const { content, headers, links, id: metaId
|
|
651
|
+
const { content, headers, links, id: metaId, ...rest } = response;
|
|
652
652
|
const responseObject = rest;
|
|
653
653
|
const maybeHeaders = createHeaders(headers, registry$1, [...path, "headers"]);
|
|
654
654
|
if (maybeHeaders) responseObject.headers = maybeHeaders;
|
|
@@ -672,7 +672,7 @@ const createRegistry = (components) => {
|
|
|
672
672
|
addCallback: (callback, path, opts) => {
|
|
673
673
|
const seenCallback = registry$1.components.callbacks.seen.get(callback);
|
|
674
674
|
if (seenCallback) return seenCallback;
|
|
675
|
-
const { id: metaId
|
|
675
|
+
const { id: metaId, ...rest } = callback;
|
|
676
676
|
const callbackObject = {};
|
|
677
677
|
for (const [name, pathItem] of Object.entries(rest)) {
|
|
678
678
|
if (isISpecificationExtension(name)) {
|
|
@@ -696,7 +696,7 @@ const createRegistry = (components) => {
|
|
|
696
696
|
addSecurityScheme: (securityScheme, path, opts) => {
|
|
697
697
|
const seenSecurityScheme = registry$1.components.securitySchemes.seen.get(securityScheme);
|
|
698
698
|
if (seenSecurityScheme) return seenSecurityScheme;
|
|
699
|
-
const { id: metaId
|
|
699
|
+
const { id: metaId, ...rest } = securityScheme;
|
|
700
700
|
const securitySchemeObject = rest;
|
|
701
701
|
const id = metaId ?? opts?.manualId;
|
|
702
702
|
if (id) {
|
|
@@ -713,7 +713,7 @@ const createRegistry = (components) => {
|
|
|
713
713
|
addLink: (link, path, opts) => {
|
|
714
714
|
const seenLink = registry$1.components.links.seen.get(link);
|
|
715
715
|
if (seenLink) return seenLink;
|
|
716
|
-
const { id: metaId
|
|
716
|
+
const { id: metaId, ...rest } = link;
|
|
717
717
|
const linkObject = rest;
|
|
718
718
|
const id = metaId ?? opts?.manualId;
|
|
719
719
|
if (id) {
|
|
@@ -730,7 +730,7 @@ const createRegistry = (components) => {
|
|
|
730
730
|
addExample: (example, path, opts) => {
|
|
731
731
|
const seenExample = registry$1.components.examples.seen.get(example);
|
|
732
732
|
if (seenExample) return seenExample;
|
|
733
|
-
const { id: metaId
|
|
733
|
+
const { id: metaId, ...rest } = example;
|
|
734
734
|
const exampleObject = rest;
|
|
735
735
|
const id = metaId ?? opts?.manualId;
|
|
736
736
|
if (id) {
|
|
@@ -913,4 +913,4 @@ const createComponents = (registry$1, opts, openapiVersion) => {
|
|
|
913
913
|
};
|
|
914
914
|
|
|
915
915
|
//#endregion
|
|
916
|
-
export {
|
|
916
|
+
export { unwrapZodObject as a, createPaths as i, createRegistry as n, isAnyZodType as o, createSchema as r, createComponents as t };
|
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
1
|
let zod_v4_core = require("zod/v4/core");
|
|
25
|
-
zod_v4_core = __toESM(zod_v4_core);
|
|
26
2
|
let zod_v4 = require("zod/v4");
|
|
27
|
-
zod_v4 = __toESM(zod_v4);
|
|
28
3
|
|
|
29
4
|
//#region src/zod.ts
|
|
30
5
|
const isAnyZodType = (schema) => typeof schema === "object" && schema !== null && "_zod" in schema;
|
|
@@ -41,7 +16,7 @@ const createExamples = (examples, registry$1, path) => {
|
|
|
41
16
|
//#endregion
|
|
42
17
|
//#region src/create/content.ts
|
|
43
18
|
const createMediaTypeObject = (mediaType, ctx, path) => {
|
|
44
|
-
const { schema, examples
|
|
19
|
+
const { schema, examples, ...rest } = mediaType;
|
|
45
20
|
const mediaTypeObject = rest;
|
|
46
21
|
if (isAnyZodType(schema)) mediaTypeObject.schema = ctx.registry.addSchema(schema, [...path, "schema"], {
|
|
47
22
|
io: ctx.io,
|
|
@@ -174,7 +149,7 @@ const createResponses = (responses, registry$1, path) => {
|
|
|
174
149
|
//#endregion
|
|
175
150
|
//#region src/create/paths.ts
|
|
176
151
|
const createOperation = (operation, registry$1, path) => {
|
|
177
|
-
const { parameters, requestParams, requestBody, responses, callbacks
|
|
152
|
+
const { parameters, requestParams, requestBody, responses, callbacks, ...rest } = operation;
|
|
178
153
|
const operationObject = rest;
|
|
179
154
|
const maybeManualParameters = createManualParameters(parameters, registry$1, [...path, "parameters"]);
|
|
180
155
|
const maybeRequestParams = createParameters(requestParams, registry$1, [...path, "requestParams"]);
|
|
@@ -223,7 +198,7 @@ const override = (ctx) => {
|
|
|
223
198
|
break;
|
|
224
199
|
case "union": {
|
|
225
200
|
if ("discriminator" in def && typeof def.discriminator === "string") {
|
|
226
|
-
ctx.jsonSchema.oneOf
|
|
201
|
+
ctx.jsonSchema.oneOf ??= ctx.jsonSchema.anyOf;
|
|
227
202
|
delete ctx.jsonSchema.anyOf;
|
|
228
203
|
ctx.jsonSchema.type = "object";
|
|
229
204
|
ctx.jsonSchema.discriminator = { propertyName: def.discriminator };
|
|
@@ -562,7 +537,7 @@ const createRegistry = (components) => {
|
|
|
562
537
|
}
|
|
563
538
|
}
|
|
564
539
|
});
|
|
565
|
-
const { id: metaId, examples
|
|
540
|
+
const { id: metaId, examples, ...rest } = meta?.param ?? {};
|
|
566
541
|
const parameterObject = {
|
|
567
542
|
in: inLocation,
|
|
568
543
|
name,
|
|
@@ -595,7 +570,7 @@ const createRegistry = (components) => {
|
|
|
595
570
|
const seenHeader = registry$1.components.headers.seen.get(header);
|
|
596
571
|
if (seenHeader) return seenHeader;
|
|
597
572
|
const meta = zod_v4_core.globalRegistry.get(header);
|
|
598
|
-
const { id: metaId
|
|
573
|
+
const { id: metaId, ...rest } = meta?.header ?? {};
|
|
599
574
|
const id = metaId ?? opts?.manualId;
|
|
600
575
|
const headerObject = rest;
|
|
601
576
|
if (isRequired(header, "output")) headerObject.required = true;
|
|
@@ -618,7 +593,7 @@ const createRegistry = (components) => {
|
|
|
618
593
|
addRequestBody: (requestBody, path, opts) => {
|
|
619
594
|
const seenRequestBody = registry$1.components.requestBodies.seen.get(requestBody);
|
|
620
595
|
if (seenRequestBody) return seenRequestBody;
|
|
621
|
-
const { content, id: metaId
|
|
596
|
+
const { content, id: metaId, ...rest } = requestBody;
|
|
622
597
|
const requestBodyObject = {
|
|
623
598
|
...rest,
|
|
624
599
|
content: createContent(content, {
|
|
@@ -642,7 +617,7 @@ const createRegistry = (components) => {
|
|
|
642
617
|
const seenPathItem = registry$1.components.pathItems.seen.get(pathItem);
|
|
643
618
|
if (seenPathItem) return seenPathItem;
|
|
644
619
|
const pathItemObject = {};
|
|
645
|
-
const { id: metaId
|
|
620
|
+
const { id: metaId, ...rest } = pathItem;
|
|
646
621
|
const id = metaId ?? opts?.manualId;
|
|
647
622
|
for (const [key, value] of Object.entries(rest)) {
|
|
648
623
|
if (isISpecificationExtension(key)) {
|
|
@@ -673,7 +648,7 @@ const createRegistry = (components) => {
|
|
|
673
648
|
addResponse: (response, path, opts) => {
|
|
674
649
|
const seenResponse = registry$1.components.responses.seen.get(response);
|
|
675
650
|
if (seenResponse) return seenResponse;
|
|
676
|
-
const { content, headers, links, id: metaId
|
|
651
|
+
const { content, headers, links, id: metaId, ...rest } = response;
|
|
677
652
|
const responseObject = rest;
|
|
678
653
|
const maybeHeaders = createHeaders(headers, registry$1, [...path, "headers"]);
|
|
679
654
|
if (maybeHeaders) responseObject.headers = maybeHeaders;
|
|
@@ -697,7 +672,7 @@ const createRegistry = (components) => {
|
|
|
697
672
|
addCallback: (callback, path, opts) => {
|
|
698
673
|
const seenCallback = registry$1.components.callbacks.seen.get(callback);
|
|
699
674
|
if (seenCallback) return seenCallback;
|
|
700
|
-
const { id: metaId
|
|
675
|
+
const { id: metaId, ...rest } = callback;
|
|
701
676
|
const callbackObject = {};
|
|
702
677
|
for (const [name, pathItem] of Object.entries(rest)) {
|
|
703
678
|
if (isISpecificationExtension(name)) {
|
|
@@ -721,7 +696,7 @@ const createRegistry = (components) => {
|
|
|
721
696
|
addSecurityScheme: (securityScheme, path, opts) => {
|
|
722
697
|
const seenSecurityScheme = registry$1.components.securitySchemes.seen.get(securityScheme);
|
|
723
698
|
if (seenSecurityScheme) return seenSecurityScheme;
|
|
724
|
-
const { id: metaId
|
|
699
|
+
const { id: metaId, ...rest } = securityScheme;
|
|
725
700
|
const securitySchemeObject = rest;
|
|
726
701
|
const id = metaId ?? opts?.manualId;
|
|
727
702
|
if (id) {
|
|
@@ -738,7 +713,7 @@ const createRegistry = (components) => {
|
|
|
738
713
|
addLink: (link, path, opts) => {
|
|
739
714
|
const seenLink = registry$1.components.links.seen.get(link);
|
|
740
715
|
if (seenLink) return seenLink;
|
|
741
|
-
const { id: metaId
|
|
716
|
+
const { id: metaId, ...rest } = link;
|
|
742
717
|
const linkObject = rest;
|
|
743
718
|
const id = metaId ?? opts?.manualId;
|
|
744
719
|
if (id) {
|
|
@@ -755,7 +730,7 @@ const createRegistry = (components) => {
|
|
|
755
730
|
addExample: (example, path, opts) => {
|
|
756
731
|
const seenExample = registry$1.components.examples.seen.get(example);
|
|
757
732
|
if (seenExample) return seenExample;
|
|
758
|
-
const { id: metaId
|
|
733
|
+
const { id: metaId, ...rest } = example;
|
|
759
734
|
const exampleObject = rest;
|
|
760
735
|
const id = metaId ?? opts?.manualId;
|
|
761
736
|
if (id) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_components = require('./components-
|
|
1
|
+
const require_components = require('./components-fd4LXedu.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/create/document.ts
|
|
4
4
|
const createDocument = (zodOpenApiObject, opts = {}) => {
|
|
5
|
-
const { paths, webhooks, components
|
|
5
|
+
const { paths, webhooks, components, ...rest } = zodOpenApiObject;
|
|
6
6
|
const document = rest;
|
|
7
7
|
const registry = require_components.createRegistry(components);
|
|
8
8
|
const createdPaths = require_components.createPaths(paths, registry, ["paths"]);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as LinkParametersObject, A as ZodOpenApiBaseMetadata, At as OpenApiVersion, B as ContactObject, C as ZodOpenApiRequestBodyObject, Ct as TagObject, D as ZodOpenApiSecuritySchemeObject, Dt as IExtensionName, E as ZodOpenApiSchemaObject, Et as ServerVariableObject, F as ZodOpenApiOverrideMetaContext, G as ExampleObject, H as DiscriminatorObject, I as BaseParameterObject, J as HeaderObject, K as ExamplesObject, L as CallbackObject, M as ZodOpenApiOverride, N as ZodOpenApiOverrideContext, O as ZodOpenApiVersion, Ot as IExtensionType, P as ZodOpenApiOverrideMeta, Q as LinkObject, R as CallbacksObject, S as ZodOpenApiPathsObject, St as SecuritySchemeType, T as ZodOpenApiResponsesObject, Tt as ServerObject, U as EncodingObject, V as ContentObject, W as EncodingPropertyObject, X as InfoObject, Y as HeadersObject, Z as LicenseObject, _ as ZodOpenApiObject, _t as SchemaObjectType, a as ZodObjectInput, at as OperationObject, b as ZodOpenApiParameters, bt as SecurityRequirementObject, c as ZodOpenApiComponentsObject, ct as ParameterStyle, d as ZodOpenApiExamplesObject, dt as PathsObject, et as LinksObject, f as ZodOpenApiHeaderObject, ft as ReferenceObject, g as ZodOpenApiMediaTypeObject, gt as SchemaObject, h as ZodOpenApiLinksObject, ht as ResponsesObject, i as CreateDocumentOptions, it as OpenAPIObject, j as ZodOpenApiMetadata, k as createDocument, kt as ISpecificationExtension, l as ZodOpenApiContentObject, lt as PathItemObject, m as ZodOpenApiLinkObject, mt as ResponseObject, nt as OAuthFlowObject, o as ZodOpenApiCallbackObject, ot as ParameterLocation, p as ZodOpenApiHeadersObject, pt as RequestBodyObject, q as ExternalDocumentationObject, rt as OAuthFlowsObject, s as ZodOpenApiCallbacksObject, st as ParameterObject, t as ComponentRegistry, tt as MediaTypeObject, u as ZodOpenApiExampleObject, ut as PathObject, v as ZodOpenApiOperationObject, vt as SchemasObject, w as ZodOpenApiResponseObject, wt as XmlObject, x as ZodOpenApiPathItemObject, xt as SecuritySchemeObject, y as ZodOpenApiParameterObject, yt as ScopesObject, z as ComponentsObject } from "./components-D3KCJ9k6.cjs";
|
|
2
2
|
import * as core from "zod/v4/core";
|
|
3
3
|
|
|
4
4
|
//#region rolldown:runtime
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as LinkParametersObject, A as ZodOpenApiBaseMetadata, At as OpenApiVersion, B as ContactObject, C as ZodOpenApiRequestBodyObject, Ct as TagObject, D as ZodOpenApiSecuritySchemeObject, Dt as IExtensionName, E as ZodOpenApiSchemaObject, Et as ServerVariableObject, F as ZodOpenApiOverrideMetaContext, G as ExampleObject, H as DiscriminatorObject, I as BaseParameterObject, J as HeaderObject, K as ExamplesObject, L as CallbackObject, M as ZodOpenApiOverride, N as ZodOpenApiOverrideContext, O as ZodOpenApiVersion, Ot as IExtensionType, P as ZodOpenApiOverrideMeta, Q as LinkObject, R as CallbacksObject, S as ZodOpenApiPathsObject, St as SecuritySchemeType, T as ZodOpenApiResponsesObject, Tt as ServerObject, U as EncodingObject, V as ContentObject, W as EncodingPropertyObject, X as InfoObject, Y as HeadersObject, Z as LicenseObject, _ as ZodOpenApiObject, _t as SchemaObjectType, a as ZodObjectInput, at as OperationObject, b as ZodOpenApiParameters, bt as SecurityRequirementObject, c as ZodOpenApiComponentsObject, ct as ParameterStyle, d as ZodOpenApiExamplesObject, dt as PathsObject, et as LinksObject, f as ZodOpenApiHeaderObject, ft as ReferenceObject, g as ZodOpenApiMediaTypeObject, gt as SchemaObject, h as ZodOpenApiLinksObject, ht as ResponsesObject, i as CreateDocumentOptions, it as OpenAPIObject, j as ZodOpenApiMetadata, k as createDocument, kt as ISpecificationExtension, l as ZodOpenApiContentObject, lt as PathItemObject, m as ZodOpenApiLinkObject, mt as ResponseObject, nt as OAuthFlowObject, o as ZodOpenApiCallbackObject, ot as ParameterLocation, p as ZodOpenApiHeadersObject, pt as RequestBodyObject, q as ExternalDocumentationObject, rt as OAuthFlowsObject, s as ZodOpenApiCallbacksObject, st as ParameterObject, t as ComponentRegistry, tt as MediaTypeObject, u as ZodOpenApiExampleObject, ut as PathObject, v as ZodOpenApiOperationObject, vt as SchemasObject, w as ZodOpenApiResponseObject, wt as XmlObject, x as ZodOpenApiPathItemObject, xt as SecuritySchemeObject, y as ZodOpenApiParameterObject, yt as ScopesObject, z as ComponentsObject } from "./components-B1DX_zYv.mjs";
|
|
2
2
|
import * as core from "zod/v4/core";
|
|
3
3
|
|
|
4
4
|
//#region rolldown:runtime
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as createPaths, n as createRegistry, r as createSchema, t as createComponents } from "./components-WUsO5AOL.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/create/document.ts
|
|
4
4
|
const createDocument = (zodOpenApiObject, opts = {}) => {
|
|
5
|
-
const { paths, webhooks, components
|
|
5
|
+
const { paths, webhooks, components, ...rest } = zodOpenApiObject;
|
|
6
6
|
const document = rest;
|
|
7
7
|
const registry = createRegistry(components);
|
|
8
8
|
const createdPaths = createPaths(paths, registry, ["paths"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod-openapi",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.5",
|
|
4
4
|
"description": "Convert Zod Schemas to OpenAPI v3.x documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"type": "module",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
-
"import": "./dist/index.
|
|
28
|
+
"import": "./dist/index.mjs",
|
|
29
29
|
"require": "./dist/index.cjs"
|
|
30
30
|
},
|
|
31
31
|
"./api": {
|
|
32
|
-
"import": "./dist/api.
|
|
32
|
+
"import": "./dist/api.mjs",
|
|
33
33
|
"require": "./dist/api.cjs"
|
|
34
34
|
},
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
37
|
"main": "./dist/index.cjs",
|
|
38
|
-
"module": "./dist/index.
|
|
38
|
+
"module": "./dist/index.mjs",
|
|
39
39
|
"types": "./dist/index.d.cts",
|
|
40
40
|
"files": [
|
|
41
41
|
"dist",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"ajv": "8.17.1",
|
|
53
53
|
"eslint-plugin-import-zod": "1.2.0",
|
|
54
54
|
"eslint-plugin-zod-openapi": "2.0.0",
|
|
55
|
-
"skuba": "12.
|
|
56
|
-
"tsdown": "0.
|
|
55
|
+
"skuba": "12.4.1",
|
|
56
|
+
"tsdown": "0.16.7",
|
|
57
57
|
"vitest": "3.2.4",
|
|
58
58
|
"yaml": "2.8.1",
|
|
59
|
-
"zod": "4.1.
|
|
59
|
+
"zod": "4.1.13"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"zod": "^3.25.74 || ^4.0.0"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"entryPoint": "src/index.ts",
|
|
73
73
|
"template": "oss-npm-package",
|
|
74
74
|
"type": "package",
|
|
75
|
-
"version": "12.
|
|
75
|
+
"version": "12.4.1"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"build": "pnpm -r build && tsdown",
|
package/dist/api.js
DELETED