zod-openapi 5.4.2 → 5.4.4
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.d.ts → api-BWCCxDX8.d.cts} +1 -1
- package/dist/{api.d.cts → api-D3cHS30q.d.ts} +1 -1
- package/dist/api.cjs +1 -1
- package/dist/api.js +1 -1
- package/dist/{components-CXzxKPFp.d.ts → components-B8qGeOfG.d.ts} +1 -1
- package/dist/{components-8XHv_FhV.js → components-CfkaVvOy.js} +14 -16
- package/dist/{components-JnL0iOr_.d.cts → components-DkkceUuA.d.cts} +1 -1
- package/dist/{components-BPKWviAb.cjs → components-fd4LXedu.cjs} +13 -40
- package/dist/index-CJpnmEXT.d.ts +32 -0
- package/dist/index-CYWAauJM.d.cts +32 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +5 -5
- package/dist/index.d.cts +0 -30
- package/dist/index.d.ts +0 -30
|
@@ -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-DkkceUuA.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-B8qGeOfG.js";
|
|
2
2
|
import * as core from "zod/v4/core";
|
|
3
3
|
import { $ZodObject, $ZodType, $ZodTypes } from "zod/v4/core";
|
|
4
4
|
|
package/dist/api.cjs
CHANGED
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as unwrapZodObject, n as createRegistry, o as isAnyZodType, t as createComponents } from "./components-CfkaVvOy.js";
|
|
2
2
|
|
|
3
3
|
export { createComponents, createRegistry, isAnyZodType, unwrapZodObject };
|
|
@@ -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 };
|
|
@@ -292,7 +292,6 @@ const renameComponents = (components, outputIds, ctx, refPath) => {
|
|
|
292
292
|
componentsToRename.set(key, newName);
|
|
293
293
|
components[newName] = components[key];
|
|
294
294
|
delete components[key];
|
|
295
|
-
continue;
|
|
296
295
|
}
|
|
297
296
|
return componentsToRename;
|
|
298
297
|
};
|
|
@@ -538,7 +537,7 @@ const createRegistry = (components) => {
|
|
|
538
537
|
}
|
|
539
538
|
}
|
|
540
539
|
});
|
|
541
|
-
const { id: metaId, examples
|
|
540
|
+
const { id: metaId, examples, ...rest } = meta?.param ?? {};
|
|
542
541
|
const parameterObject = {
|
|
543
542
|
in: inLocation,
|
|
544
543
|
name,
|
|
@@ -571,7 +570,7 @@ const createRegistry = (components) => {
|
|
|
571
570
|
const seenHeader = registry$1.components.headers.seen.get(header);
|
|
572
571
|
if (seenHeader) return seenHeader;
|
|
573
572
|
const meta = globalRegistry.get(header);
|
|
574
|
-
const { id: metaId
|
|
573
|
+
const { id: metaId, ...rest } = meta?.header ?? {};
|
|
575
574
|
const id = metaId ?? opts?.manualId;
|
|
576
575
|
const headerObject = rest;
|
|
577
576
|
if (isRequired(header, "output")) headerObject.required = true;
|
|
@@ -594,7 +593,7 @@ const createRegistry = (components) => {
|
|
|
594
593
|
addRequestBody: (requestBody, path, opts) => {
|
|
595
594
|
const seenRequestBody = registry$1.components.requestBodies.seen.get(requestBody);
|
|
596
595
|
if (seenRequestBody) return seenRequestBody;
|
|
597
|
-
const { content, id: metaId
|
|
596
|
+
const { content, id: metaId, ...rest } = requestBody;
|
|
598
597
|
const requestBodyObject = {
|
|
599
598
|
...rest,
|
|
600
599
|
content: createContent(content, {
|
|
@@ -618,7 +617,7 @@ const createRegistry = (components) => {
|
|
|
618
617
|
const seenPathItem = registry$1.components.pathItems.seen.get(pathItem);
|
|
619
618
|
if (seenPathItem) return seenPathItem;
|
|
620
619
|
const pathItemObject = {};
|
|
621
|
-
const { id: metaId
|
|
620
|
+
const { id: metaId, ...rest } = pathItem;
|
|
622
621
|
const id = metaId ?? opts?.manualId;
|
|
623
622
|
for (const [key, value] of Object.entries(rest)) {
|
|
624
623
|
if (isISpecificationExtension(key)) {
|
|
@@ -649,7 +648,7 @@ const createRegistry = (components) => {
|
|
|
649
648
|
addResponse: (response, path, opts) => {
|
|
650
649
|
const seenResponse = registry$1.components.responses.seen.get(response);
|
|
651
650
|
if (seenResponse) return seenResponse;
|
|
652
|
-
const { content, headers, links, id: metaId
|
|
651
|
+
const { content, headers, links, id: metaId, ...rest } = response;
|
|
653
652
|
const responseObject = rest;
|
|
654
653
|
const maybeHeaders = createHeaders(headers, registry$1, [...path, "headers"]);
|
|
655
654
|
if (maybeHeaders) responseObject.headers = maybeHeaders;
|
|
@@ -673,7 +672,7 @@ const createRegistry = (components) => {
|
|
|
673
672
|
addCallback: (callback, path, opts) => {
|
|
674
673
|
const seenCallback = registry$1.components.callbacks.seen.get(callback);
|
|
675
674
|
if (seenCallback) return seenCallback;
|
|
676
|
-
const { id: metaId
|
|
675
|
+
const { id: metaId, ...rest } = callback;
|
|
677
676
|
const callbackObject = {};
|
|
678
677
|
for (const [name, pathItem] of Object.entries(rest)) {
|
|
679
678
|
if (isISpecificationExtension(name)) {
|
|
@@ -697,7 +696,7 @@ const createRegistry = (components) => {
|
|
|
697
696
|
addSecurityScheme: (securityScheme, path, opts) => {
|
|
698
697
|
const seenSecurityScheme = registry$1.components.securitySchemes.seen.get(securityScheme);
|
|
699
698
|
if (seenSecurityScheme) return seenSecurityScheme;
|
|
700
|
-
const { id: metaId
|
|
699
|
+
const { id: metaId, ...rest } = securityScheme;
|
|
701
700
|
const securitySchemeObject = rest;
|
|
702
701
|
const id = metaId ?? opts?.manualId;
|
|
703
702
|
if (id) {
|
|
@@ -714,7 +713,7 @@ const createRegistry = (components) => {
|
|
|
714
713
|
addLink: (link, path, opts) => {
|
|
715
714
|
const seenLink = registry$1.components.links.seen.get(link);
|
|
716
715
|
if (seenLink) return seenLink;
|
|
717
|
-
const { id: metaId
|
|
716
|
+
const { id: metaId, ...rest } = link;
|
|
718
717
|
const linkObject = rest;
|
|
719
718
|
const id = metaId ?? opts?.manualId;
|
|
720
719
|
if (id) {
|
|
@@ -731,7 +730,7 @@ const createRegistry = (components) => {
|
|
|
731
730
|
addExample: (example, path, opts) => {
|
|
732
731
|
const seenExample = registry$1.components.examples.seen.get(example);
|
|
733
732
|
if (seenExample) return seenExample;
|
|
734
|
-
const { id: metaId
|
|
733
|
+
const { id: metaId, ...rest } = example;
|
|
735
734
|
const exampleObject = rest;
|
|
736
735
|
const id = metaId ?? opts?.manualId;
|
|
737
736
|
if (id) {
|
|
@@ -881,8 +880,7 @@ const createIOSchemas = (ctx) => {
|
|
|
881
880
|
};
|
|
882
881
|
const createManualSchemas = (registry$1) => {
|
|
883
882
|
for (const [key, value] of registry$1.components.schemas.manual) if (!value.input.used) {
|
|
884
|
-
const
|
|
885
|
-
const schema = value[io].schemaObject;
|
|
883
|
+
const schema = value[globalRegistry.get(value.zodType)?.unusedIO ?? "output"].schemaObject;
|
|
886
884
|
registry$1.components.schemas.ids.set(key, schema);
|
|
887
885
|
}
|
|
888
886
|
};
|
|
@@ -915,4 +913,4 @@ const createComponents = (registry$1, opts, openapiVersion) => {
|
|
|
915
913
|
};
|
|
916
914
|
|
|
917
915
|
//#endregion
|
|
918
|
-
export {
|
|
916
|
+
export { unwrapZodObject as a, createPaths as i, createRegistry as n, isAnyZodType as o, createSchema as r, createComponents as t };
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -317,7 +292,6 @@ const renameComponents = (components, outputIds, ctx, refPath) => {
|
|
|
317
292
|
componentsToRename.set(key, newName);
|
|
318
293
|
components[newName] = components[key];
|
|
319
294
|
delete components[key];
|
|
320
|
-
continue;
|
|
321
295
|
}
|
|
322
296
|
return componentsToRename;
|
|
323
297
|
};
|
|
@@ -563,7 +537,7 @@ const createRegistry = (components) => {
|
|
|
563
537
|
}
|
|
564
538
|
}
|
|
565
539
|
});
|
|
566
|
-
const { id: metaId, examples
|
|
540
|
+
const { id: metaId, examples, ...rest } = meta?.param ?? {};
|
|
567
541
|
const parameterObject = {
|
|
568
542
|
in: inLocation,
|
|
569
543
|
name,
|
|
@@ -596,7 +570,7 @@ const createRegistry = (components) => {
|
|
|
596
570
|
const seenHeader = registry$1.components.headers.seen.get(header);
|
|
597
571
|
if (seenHeader) return seenHeader;
|
|
598
572
|
const meta = zod_v4_core.globalRegistry.get(header);
|
|
599
|
-
const { id: metaId
|
|
573
|
+
const { id: metaId, ...rest } = meta?.header ?? {};
|
|
600
574
|
const id = metaId ?? opts?.manualId;
|
|
601
575
|
const headerObject = rest;
|
|
602
576
|
if (isRequired(header, "output")) headerObject.required = true;
|
|
@@ -619,7 +593,7 @@ const createRegistry = (components) => {
|
|
|
619
593
|
addRequestBody: (requestBody, path, opts) => {
|
|
620
594
|
const seenRequestBody = registry$1.components.requestBodies.seen.get(requestBody);
|
|
621
595
|
if (seenRequestBody) return seenRequestBody;
|
|
622
|
-
const { content, id: metaId
|
|
596
|
+
const { content, id: metaId, ...rest } = requestBody;
|
|
623
597
|
const requestBodyObject = {
|
|
624
598
|
...rest,
|
|
625
599
|
content: createContent(content, {
|
|
@@ -643,7 +617,7 @@ const createRegistry = (components) => {
|
|
|
643
617
|
const seenPathItem = registry$1.components.pathItems.seen.get(pathItem);
|
|
644
618
|
if (seenPathItem) return seenPathItem;
|
|
645
619
|
const pathItemObject = {};
|
|
646
|
-
const { id: metaId
|
|
620
|
+
const { id: metaId, ...rest } = pathItem;
|
|
647
621
|
const id = metaId ?? opts?.manualId;
|
|
648
622
|
for (const [key, value] of Object.entries(rest)) {
|
|
649
623
|
if (isISpecificationExtension(key)) {
|
|
@@ -674,7 +648,7 @@ const createRegistry = (components) => {
|
|
|
674
648
|
addResponse: (response, path, opts) => {
|
|
675
649
|
const seenResponse = registry$1.components.responses.seen.get(response);
|
|
676
650
|
if (seenResponse) return seenResponse;
|
|
677
|
-
const { content, headers, links, id: metaId
|
|
651
|
+
const { content, headers, links, id: metaId, ...rest } = response;
|
|
678
652
|
const responseObject = rest;
|
|
679
653
|
const maybeHeaders = createHeaders(headers, registry$1, [...path, "headers"]);
|
|
680
654
|
if (maybeHeaders) responseObject.headers = maybeHeaders;
|
|
@@ -698,7 +672,7 @@ const createRegistry = (components) => {
|
|
|
698
672
|
addCallback: (callback, path, opts) => {
|
|
699
673
|
const seenCallback = registry$1.components.callbacks.seen.get(callback);
|
|
700
674
|
if (seenCallback) return seenCallback;
|
|
701
|
-
const { id: metaId
|
|
675
|
+
const { id: metaId, ...rest } = callback;
|
|
702
676
|
const callbackObject = {};
|
|
703
677
|
for (const [name, pathItem] of Object.entries(rest)) {
|
|
704
678
|
if (isISpecificationExtension(name)) {
|
|
@@ -722,7 +696,7 @@ const createRegistry = (components) => {
|
|
|
722
696
|
addSecurityScheme: (securityScheme, path, opts) => {
|
|
723
697
|
const seenSecurityScheme = registry$1.components.securitySchemes.seen.get(securityScheme);
|
|
724
698
|
if (seenSecurityScheme) return seenSecurityScheme;
|
|
725
|
-
const { id: metaId
|
|
699
|
+
const { id: metaId, ...rest } = securityScheme;
|
|
726
700
|
const securitySchemeObject = rest;
|
|
727
701
|
const id = metaId ?? opts?.manualId;
|
|
728
702
|
if (id) {
|
|
@@ -739,7 +713,7 @@ const createRegistry = (components) => {
|
|
|
739
713
|
addLink: (link, path, opts) => {
|
|
740
714
|
const seenLink = registry$1.components.links.seen.get(link);
|
|
741
715
|
if (seenLink) return seenLink;
|
|
742
|
-
const { id: metaId
|
|
716
|
+
const { id: metaId, ...rest } = link;
|
|
743
717
|
const linkObject = rest;
|
|
744
718
|
const id = metaId ?? opts?.manualId;
|
|
745
719
|
if (id) {
|
|
@@ -756,7 +730,7 @@ const createRegistry = (components) => {
|
|
|
756
730
|
addExample: (example, path, opts) => {
|
|
757
731
|
const seenExample = registry$1.components.examples.seen.get(example);
|
|
758
732
|
if (seenExample) return seenExample;
|
|
759
|
-
const { id: metaId
|
|
733
|
+
const { id: metaId, ...rest } = example;
|
|
760
734
|
const exampleObject = rest;
|
|
761
735
|
const id = metaId ?? opts?.manualId;
|
|
762
736
|
if (id) {
|
|
@@ -906,8 +880,7 @@ const createIOSchemas = (ctx) => {
|
|
|
906
880
|
};
|
|
907
881
|
const createManualSchemas = (registry$1) => {
|
|
908
882
|
for (const [key, value] of registry$1.components.schemas.manual) if (!value.input.used) {
|
|
909
|
-
const
|
|
910
|
-
const schema = value[io].schemaObject;
|
|
883
|
+
const schema = value[zod_v4_core.globalRegistry.get(value.zodType)?.unusedIO ?? "output"].schemaObject;
|
|
911
884
|
registry$1.components.schemas.ids.set(key, schema);
|
|
912
885
|
}
|
|
913
886
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
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-B8qGeOfG.js";
|
|
2
|
+
import * as core from "zod/v4/core";
|
|
3
|
+
|
|
4
|
+
//#region rolldown:runtime
|
|
5
|
+
declare namespace oas31_d_exports {
|
|
6
|
+
export { BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, IExtensionName, IExtensionType, ISpecificationExtension, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, PathItemObject, PathObject, PathsObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, TagObject, XmlObject };
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/create/schema/schema.d.ts
|
|
10
|
+
interface SchemaResult {
|
|
11
|
+
schema: SchemaObject | ReferenceObject;
|
|
12
|
+
components: Record<string, SchemaObject>;
|
|
13
|
+
}
|
|
14
|
+
declare const createSchema: (schema: core.$ZodType, ctx?: {
|
|
15
|
+
registry?: ComponentRegistry;
|
|
16
|
+
io?: "input" | "output";
|
|
17
|
+
opts?: CreateDocumentOptions;
|
|
18
|
+
/**
|
|
19
|
+
* The registry schemas to use for the schema components.
|
|
20
|
+
*/
|
|
21
|
+
schemaComponents?: ZodOpenApiComponentsObject["schemas"];
|
|
22
|
+
/**
|
|
23
|
+
* The $ref path to use for a schema component. Defaults to `#/components/schemas/`
|
|
24
|
+
*/
|
|
25
|
+
schemaRefPath?: string;
|
|
26
|
+
openapiVersion?: OpenApiVersion;
|
|
27
|
+
}) => {
|
|
28
|
+
schema: SchemaObject | ReferenceObject;
|
|
29
|
+
components: Record<string, SchemaObject>;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { CreateDocumentOptions, type SchemaResult, ZodObjectInput, ZodOpenApiBaseMetadata, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiExampleObject, ZodOpenApiExamplesObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiLinkObject, ZodOpenApiLinksObject, ZodOpenApiMediaTypeObject, ZodOpenApiMetadata, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiOverride, ZodOpenApiOverrideContext, ZodOpenApiOverrideMeta, ZodOpenApiOverrideMetaContext, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiSecuritySchemeObject, ZodOpenApiVersion, createDocument, createSchema, oas31_d_exports as oas31 };
|
|
@@ -0,0 +1,32 @@
|
|
|
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-DkkceUuA.cjs";
|
|
2
|
+
import * as core from "zod/v4/core";
|
|
3
|
+
|
|
4
|
+
//#region rolldown:runtime
|
|
5
|
+
declare namespace oas31_d_exports {
|
|
6
|
+
export { BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, IExtensionName, IExtensionType, ISpecificationExtension, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, PathItemObject, PathObject, PathsObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, TagObject, XmlObject };
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/create/schema/schema.d.ts
|
|
10
|
+
interface SchemaResult {
|
|
11
|
+
schema: SchemaObject | ReferenceObject;
|
|
12
|
+
components: Record<string, SchemaObject>;
|
|
13
|
+
}
|
|
14
|
+
declare const createSchema: (schema: core.$ZodType, ctx?: {
|
|
15
|
+
registry?: ComponentRegistry;
|
|
16
|
+
io?: "input" | "output";
|
|
17
|
+
opts?: CreateDocumentOptions;
|
|
18
|
+
/**
|
|
19
|
+
* The registry schemas to use for the schema components.
|
|
20
|
+
*/
|
|
21
|
+
schemaComponents?: ZodOpenApiComponentsObject["schemas"];
|
|
22
|
+
/**
|
|
23
|
+
* The $ref path to use for a schema component. Defaults to `#/components/schemas/`
|
|
24
|
+
*/
|
|
25
|
+
schemaRefPath?: string;
|
|
26
|
+
openapiVersion?: OpenApiVersion;
|
|
27
|
+
}) => {
|
|
28
|
+
schema: SchemaObject | ReferenceObject;
|
|
29
|
+
components: Record<string, SchemaObject>;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { CreateDocumentOptions, type SchemaResult, ZodObjectInput, ZodOpenApiBaseMetadata, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiExampleObject, ZodOpenApiExamplesObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiLinkObject, ZodOpenApiLinksObject, ZodOpenApiMediaTypeObject, ZodOpenApiMetadata, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiOverride, ZodOpenApiOverrideContext, ZodOpenApiOverrideMeta, ZodOpenApiOverrideMetaContext, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiSecuritySchemeObject, ZodOpenApiVersion, createDocument, createSchema, oas31_d_exports as oas31 };
|
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.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as createPaths, n as createRegistry, r as createSchema, t as createComponents } from "./components-CfkaVvOy.js";
|
|
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.4",
|
|
4
4
|
"description": "Convert Zod Schemas to OpenAPI v3.x documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -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.15.6",
|
|
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/index.d.cts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BaseParameterObject, CallbackObject, CallbacksObject, ComponentRegistry, ComponentsObject, ContactObject, ContentObject, CreateDocumentOptions, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, IExtensionName, IExtensionType, ISpecificationExtension, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OpenApiVersion, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, PathItemObject, PathObject, PathsObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, TagObject, XmlObject, ZodObjectInput, ZodOpenApiBaseMetadata, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiExampleObject, ZodOpenApiExamplesObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiLinkObject, ZodOpenApiLinksObject, ZodOpenApiMediaTypeObject, ZodOpenApiMetadata, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiOverride, ZodOpenApiOverrideContext, ZodOpenApiOverrideMeta, ZodOpenApiOverrideMetaContext, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiSecuritySchemeObject, ZodOpenApiVersion, createDocument } from "./components-JnL0iOr_.cjs";
|
|
2
|
-
import * as core from "zod/v4/core";
|
|
3
|
-
|
|
4
|
-
//#region rolldown:runtime
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/create/schema/schema.d.ts
|
|
8
|
-
interface SchemaResult {
|
|
9
|
-
schema: SchemaObject | ReferenceObject;
|
|
10
|
-
components: Record<string, SchemaObject>;
|
|
11
|
-
}
|
|
12
|
-
declare const createSchema: (schema: core.$ZodType, ctx?: {
|
|
13
|
-
registry?: ComponentRegistry;
|
|
14
|
-
io?: "input" | "output";
|
|
15
|
-
opts?: CreateDocumentOptions;
|
|
16
|
-
/**
|
|
17
|
-
* The registry schemas to use for the schema components.
|
|
18
|
-
*/
|
|
19
|
-
schemaComponents?: ZodOpenApiComponentsObject["schemas"];
|
|
20
|
-
/**
|
|
21
|
-
* The $ref path to use for a schema component. Defaults to `#/components/schemas/`
|
|
22
|
-
*/
|
|
23
|
-
schemaRefPath?: string;
|
|
24
|
-
openapiVersion?: OpenApiVersion;
|
|
25
|
-
}) => {
|
|
26
|
-
schema: SchemaObject | ReferenceObject;
|
|
27
|
-
components: Record<string, SchemaObject>;
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
export { CreateDocumentOptions, type SchemaResult, ZodObjectInput, ZodOpenApiBaseMetadata, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiExampleObject, ZodOpenApiExamplesObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiLinkObject, ZodOpenApiLinksObject, ZodOpenApiMediaTypeObject, ZodOpenApiMetadata, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiOverride, ZodOpenApiOverrideContext, ZodOpenApiOverrideMeta, ZodOpenApiOverrideMetaContext, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiSecuritySchemeObject, ZodOpenApiVersion, createDocument, createSchema, oas31_d_exports as oas31 };
|
package/dist/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BaseParameterObject, CallbackObject, CallbacksObject, ComponentRegistry, ComponentsObject, ContactObject, ContentObject, CreateDocumentOptions, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, IExtensionName, IExtensionType, ISpecificationExtension, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OpenApiVersion, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, PathItemObject, PathObject, PathsObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, TagObject, XmlObject, ZodObjectInput, ZodOpenApiBaseMetadata, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiExampleObject, ZodOpenApiExamplesObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiLinkObject, ZodOpenApiLinksObject, ZodOpenApiMediaTypeObject, ZodOpenApiMetadata, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiOverride, ZodOpenApiOverrideContext, ZodOpenApiOverrideMeta, ZodOpenApiOverrideMetaContext, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiSecuritySchemeObject, ZodOpenApiVersion, createDocument } from "./components-CXzxKPFp.js";
|
|
2
|
-
import * as core from "zod/v4/core";
|
|
3
|
-
|
|
4
|
-
//#region rolldown:runtime
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/create/schema/schema.d.ts
|
|
8
|
-
interface SchemaResult {
|
|
9
|
-
schema: SchemaObject | ReferenceObject;
|
|
10
|
-
components: Record<string, SchemaObject>;
|
|
11
|
-
}
|
|
12
|
-
declare const createSchema: (schema: core.$ZodType, ctx?: {
|
|
13
|
-
registry?: ComponentRegistry;
|
|
14
|
-
io?: "input" | "output";
|
|
15
|
-
opts?: CreateDocumentOptions;
|
|
16
|
-
/**
|
|
17
|
-
* The registry schemas to use for the schema components.
|
|
18
|
-
*/
|
|
19
|
-
schemaComponents?: ZodOpenApiComponentsObject["schemas"];
|
|
20
|
-
/**
|
|
21
|
-
* The $ref path to use for a schema component. Defaults to `#/components/schemas/`
|
|
22
|
-
*/
|
|
23
|
-
schemaRefPath?: string;
|
|
24
|
-
openapiVersion?: OpenApiVersion;
|
|
25
|
-
}) => {
|
|
26
|
-
schema: SchemaObject | ReferenceObject;
|
|
27
|
-
components: Record<string, SchemaObject>;
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
export { CreateDocumentOptions, type SchemaResult, ZodObjectInput, ZodOpenApiBaseMetadata, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiExampleObject, ZodOpenApiExamplesObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiLinkObject, ZodOpenApiLinksObject, ZodOpenApiMediaTypeObject, ZodOpenApiMetadata, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiOverride, ZodOpenApiOverrideContext, ZodOpenApiOverrideMeta, ZodOpenApiOverrideMetaContext, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiSecuritySchemeObject, ZodOpenApiVersion, createDocument, createSchema, oas31_d_exports as oas31 };
|