zod-openapi 5.4.6 → 6.0.0
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/README.md +3 -3
- package/api/package.json +7 -3
- package/lib/api.cjs +6 -0
- package/lib/api.d.cts +7 -0
- package/lib/api.d.mts +7 -0
- package/{dist → lib}/api.mjs +2 -3
- package/{dist/components-ZWafjNVh.cjs → lib/components-BDEwP6Uu.cjs} +230 -208
- package/{dist/components-Bl1eJexW.d.mts → lib/components-DfsFcO5r.d.cts} +93 -14
- package/{dist/components-CpNqFsIP.d.cts → lib/components-DfsFcO5r.d.mts} +93 -14
- package/{dist/components-DiNDbisK.mjs → lib/components-DgApn4JL.mjs} +200 -178
- package/{dist → lib}/index.cjs +2 -13
- package/lib/index.d.cts +332 -0
- package/lib/index.d.mts +332 -0
- package/{dist → lib}/index.mjs +2 -8
- package/package.json +20 -27
- package/api/index.d.cts +0 -1
- package/api/index.d.ts +0 -1
- package/dist/api.cjs +0 -6
- package/dist/api.d.cts +0 -7
- package/dist/api.d.mts +0 -7
- package/dist/index.d.cts +0 -32
- package/dist/index.d.mts +0 -32
package/{dist → lib}/index.mjs
RENAMED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { i as createPaths, n as createRegistry, r as createSchema, t as createComponents } from "./components-
|
|
2
|
-
|
|
1
|
+
import { i as createPaths, n as createRegistry, r as createSchema, t as createComponents } from "./components-DgApn4JL.mjs";
|
|
3
2
|
//#region src/create/document.ts
|
|
4
3
|
const createDocument = (zodOpenApiObject, opts = {}) => {
|
|
5
4
|
const { paths, webhooks, components, ...rest } = zodOpenApiObject;
|
|
@@ -13,10 +12,5 @@ const createDocument = (zodOpenApiObject, opts = {}) => {
|
|
|
13
12
|
if (Object.keys(createdComponents).length > 0) document.components = createdComponents;
|
|
14
13
|
return document;
|
|
15
14
|
};
|
|
16
|
-
|
|
17
15
|
//#endregion
|
|
18
|
-
|
|
19
|
-
var oas31_exports = {};
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { createDocument, createSchema, oas31_exports as oas31 };
|
|
16
|
+
export { createDocument, createSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod-openapi",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Convert Zod Schemas to OpenAPI v3.x documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -25,43 +25,37 @@
|
|
|
25
25
|
"type": "module",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"import": "./lib/index.mjs",
|
|
29
|
+
"require": "./lib/index.cjs"
|
|
30
30
|
},
|
|
31
31
|
"./api": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"import": "./lib/api.mjs",
|
|
33
|
+
"require": "./lib/api.cjs"
|
|
34
34
|
},
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
|
-
"main": "./
|
|
38
|
-
"module": "./
|
|
39
|
-
"types": "./
|
|
37
|
+
"main": "./lib/index.cjs",
|
|
38
|
+
"module": "./lib/index.mjs",
|
|
39
|
+
"types": "./lib/index.d.cts",
|
|
40
40
|
"files": [
|
|
41
|
-
"
|
|
41
|
+
"lib",
|
|
42
42
|
"api"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@changesets/changelog-github": "0.5.2",
|
|
47
|
-
"@changesets/cli": "2.29.8",
|
|
48
|
-
"@redocly/cli": "2.0.8",
|
|
45
|
+
"@redocly/cli": "2.14.3",
|
|
49
46
|
"@types/node": "22.15.21",
|
|
50
|
-
"@vitest/coverage-v8": "3.2.4",
|
|
51
|
-
"@zod-openapi/openapi3-ts": "1.0.0",
|
|
52
47
|
"ajv": "8.17.1",
|
|
53
48
|
"eslint-plugin-zod-openapi": "2.0.0",
|
|
54
|
-
"skuba": "
|
|
55
|
-
"tsdown": "0.18.4",
|
|
56
|
-
"vitest": "3.2.4",
|
|
49
|
+
"skuba": "16.2.0-hoist-changesets-20260614023310",
|
|
57
50
|
"yaml": "2.8.1",
|
|
58
|
-
"zod": "4.3.5"
|
|
51
|
+
"zod": "4.3.5",
|
|
52
|
+
"@zod-openapi/openapi3-ts": "0.0.0"
|
|
59
53
|
},
|
|
60
54
|
"peerDependencies": {
|
|
61
|
-
"zod": "^
|
|
55
|
+
"zod": "^4.0.0"
|
|
62
56
|
},
|
|
63
57
|
"engines": {
|
|
64
|
-
"node": ">=
|
|
58
|
+
"node": ">=22.14.0"
|
|
65
59
|
},
|
|
66
60
|
"publishConfig": {
|
|
67
61
|
"provenance": true,
|
|
@@ -71,18 +65,17 @@
|
|
|
71
65
|
"entryPoint": "src/index.ts",
|
|
72
66
|
"template": "oss-npm-package",
|
|
73
67
|
"type": "package",
|
|
74
|
-
"version": "
|
|
68
|
+
"version": "16.2.0-hoist-changesets-20260614023310"
|
|
75
69
|
},
|
|
76
70
|
"scripts": {
|
|
77
|
-
"build": "
|
|
71
|
+
"build": "skuba build-package",
|
|
78
72
|
"copy:types": "skuba node scripts/copyTypes.ts",
|
|
79
73
|
"create:docs": " skuba node examples/simple/createSchema.ts && redocly build-docs examples/simple/openapi.yml --output=examples/simple/redoc-static.html",
|
|
80
74
|
"format": "skuba format",
|
|
81
75
|
"lint": "skuba lint",
|
|
82
76
|
"release": "pnpm build && changeset publish",
|
|
83
|
-
"test": "
|
|
84
|
-
"test:ci": "
|
|
85
|
-
"test:watch": "
|
|
86
|
-
"validate:pack": "attw --pack ."
|
|
77
|
+
"test": "skuba test",
|
|
78
|
+
"test:ci": "skuba test --coverage",
|
|
79
|
+
"test:watch": "skuba test --watch"
|
|
87
80
|
}
|
|
88
81
|
}
|
package/api/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/api.cjs';
|
package/api/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../dist/api.js';
|
package/dist/api.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const require_components = require('./components-ZWafjNVh.cjs');
|
|
2
|
-
|
|
3
|
-
exports.createComponents = require_components.createComponents;
|
|
4
|
-
exports.createRegistry = require_components.createRegistry;
|
|
5
|
-
exports.isAnyZodType = require_components.isAnyZodType;
|
|
6
|
-
exports.unwrapZodObject = require_components.unwrapZodObject;
|
package/dist/api.d.cts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { A as ZodOpenApiBaseMetadata, At as isAnyZodType, 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-CpNqFsIP.cjs";
|
|
2
|
-
import { $ZodObject, $ZodType, $ZodTypes } from "zod/v4/core";
|
|
3
|
-
|
|
4
|
-
//#region src/create/object.d.ts
|
|
5
|
-
declare const unwrapZodObject: (zodType: $ZodTypes, io: "input" | "output", path: string[]) => $ZodObject;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { type ComponentRegistry, ZodOpenApiBaseMetadata, ZodOpenApiMetadata, ZodOpenApiOverride, ZodOpenApiOverrideContext, ZodOpenApiOverrideMeta, ZodOpenApiOverrideMetaContext, createComponents, createRegistry, isAnyZodType, unwrapZodObject };
|
package/dist/api.d.mts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { A as ZodOpenApiBaseMetadata, At as isAnyZodType, 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-Bl1eJexW.mjs";
|
|
2
|
-
import { $ZodObject, $ZodType, $ZodTypes } from "zod/v4/core";
|
|
3
|
-
|
|
4
|
-
//#region src/create/object.d.ts
|
|
5
|
-
declare const unwrapZodObject: (zodType: $ZodTypes, io: "input" | "output", path: string[]) => $ZodObject;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { type ComponentRegistry, ZodOpenApiBaseMetadata, ZodOpenApiMetadata, ZodOpenApiOverride, ZodOpenApiOverrideContext, ZodOpenApiOverrideMeta, ZodOpenApiOverrideMetaContext, createComponents, createRegistry, isAnyZodType, unwrapZodObject };
|
package/dist/index.d.cts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { $ as LinkParametersObject, A as ZodOpenApiBaseMetadata, 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, jt as OpenApiVersion, 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-CpNqFsIP.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.d.mts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { $ as LinkParametersObject, A as ZodOpenApiBaseMetadata, 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, jt as OpenApiVersion, 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-Bl1eJexW.mjs";
|
|
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 };
|