zod-openapi 5.0.0-beta.0 → 5.0.0-beta.10
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 +5 -9
- package/api/index.d.ts +1 -1
- package/dist/api.d.mts +11 -5
- package/dist/api.d.ts +11 -5
- package/dist/api.js +6 -0
- package/dist/api.mjs +3 -8
- package/dist/components-Cp63fKGN.js +805 -0
- package/dist/components-CtvxFnRF.d.ts +559 -0
- package/dist/components-DKJ1Dtzd.mjs +747 -0
- package/dist/components-DLZ-sf1V.d.mts +559 -0
- package/dist/index.d.mts +23 -5
- package/dist/index.d.ts +23 -5
- package/dist/index.js +19 -0
- package/dist/index.mjs +16 -22
- package/package.json +10 -31
- package/dist/api.cjs +0 -8
- package/dist/components.chunk.cjs +0 -1078
- package/dist/components.chunk.mjs +0 -1079
- package/dist/create/components.d.ts +0 -85
- package/dist/create/content.d.ts +0 -10
- package/dist/create/document.d.ts +0 -97
- package/dist/create/object.d.ts +0 -5
- package/dist/create/parameters.d.ts +0 -14
- package/dist/create/schema/schema.d.ts +0 -21
- package/dist/index.cjs +0 -23
- package/dist/openapi.d.ts +0 -5
- package/dist/openapi3-ts/dist/model/oas-common.d.ts +0 -16
- package/dist/openapi3-ts/dist/model/openapi31.d.ts +0 -302
- package/dist/openapi3-ts/dist/model/specification-extension.d.ts +0 -7
- package/dist/openapi3-ts/oas31.d.ts +0 -3
- package/dist/zod.d.ts +0 -49
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="zod-openapi.
|
|
2
|
+
<img src="zod-openapi.png" width="200px" align="center" alt="zod-openapi logo" />
|
|
3
3
|
<h1 align="center">zod-openapi</h1>
|
|
4
4
|
</p>
|
|
5
5
|
<p align="center">
|
|
@@ -8,7 +8,7 @@ A TypeScript library which uses <a href="https://github.com/colinhacks/zod">Zod<
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
<a href="https://www.npmjs.com/package/zod-openapi"><img src="https://img.shields.io/npm/v/zod-openapi"/></a>
|
|
10
10
|
<a href="https://www.npmjs.com/package/zod-openapi"><img src="https://img.shields.io/npm/dm/zod-openapi"/></a>
|
|
11
|
-
<a href="https://nodejs.org/en/"><img src="https://img.shields.io/
|
|
11
|
+
<a href="https://nodejs.org/en/"><img src="https://img.shields.io/node/v/zod-openapi"/></a>
|
|
12
12
|
<a href="https://github.com/samchungy/zod-openapi/actions/workflows/test.yml"><img src="https://github.com/samchungy/zod-openapi/actions/workflows/test.yml/badge.svg"/></a>
|
|
13
13
|
<a href="https://github.com/samchungy/zod-openapi/actions/workflows/release.yml"><img src="https://github.com/samchungy/zod-openapi/actions/workflows/release.yml/badge.svg"/></a>
|
|
14
14
|
<a href="https://github.com/seek-oss/skuba"><img src="https://img.shields.io/badge/🤿%20skuba-powered-009DC4"/></a>
|
|
@@ -42,17 +42,13 @@ Use the `.meta()` method to add metadata to a Zod schema. It accepts an object w
|
|
|
42
42
|
| `outputId` | Allows you to set a different ID for the output schema. This is useful when the input and output schemas differ. |
|
|
43
43
|
| `unusedIO` | Allows you to set the `io` for an unused schema added to the components section. Defaults to `output` |
|
|
44
44
|
|
|
45
|
-
`````typescript
|
|
46
|
-
|
|
47
|
-
````typescript
|
|
48
|
-
|
|
49
45
|
### `createDocument`
|
|
50
46
|
|
|
51
47
|
Generates an OpenAPI documentation object.
|
|
52
48
|
|
|
53
49
|
```typescript
|
|
54
50
|
import 'zod-openapi/extend';
|
|
55
|
-
import { z } from 'zod';
|
|
51
|
+
import { z } from 'zod/v4';
|
|
56
52
|
import { createDocument } from 'zod-openapi';
|
|
57
53
|
|
|
58
54
|
const jobId = z.string().openapi({
|
|
@@ -93,7 +89,7 @@ const document = createDocument({
|
|
|
93
89
|
},
|
|
94
90
|
},
|
|
95
91
|
});
|
|
96
|
-
|
|
92
|
+
```
|
|
97
93
|
|
|
98
94
|
<details>
|
|
99
95
|
<summary>Creates the following object:</summary>
|
|
@@ -195,7 +191,7 @@ Creates an OpenAPI Schema Object along with any registered components. OpenAPI 3
|
|
|
195
191
|
|
|
196
192
|
```typescript
|
|
197
193
|
import 'zod-openapi/extend';
|
|
198
|
-
import { z } from 'zod';
|
|
194
|
+
import { z } from 'zod/v4';
|
|
199
195
|
import { createSchema } from 'zod-openapi';
|
|
200
196
|
|
|
201
197
|
const jobId = z.string().openapi({
|
package/api/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from '../dist/api';
|
package/dist/api.d.mts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ComponentRegistry, Override, createComponents, createRegistry } from "./components-DLZ-sf1V.mjs";
|
|
2
|
+
import { $ZodObject, $ZodType, $ZodTypes } from "zod/v4/core";
|
|
3
|
+
import { core } from "zod/v4";
|
|
4
|
+
|
|
5
|
+
//#region src/create/object.d.ts
|
|
6
|
+
declare const unwrapZodObject: (zodType: $ZodTypes, io: "input" | "output", path: string[]) => $ZodObject;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/zod.d.ts
|
|
9
|
+
declare const isAnyZodType: (schema: unknown) => schema is core.$ZodTypes;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ComponentRegistry, Override, createComponents, createRegistry, isAnyZodType, unwrapZodObject };
|
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ComponentRegistry, Override, createComponents, createRegistry } from "./components-CtvxFnRF.js";
|
|
2
|
+
import { $ZodObject, $ZodType, $ZodTypes } from "zod/v4/core";
|
|
3
|
+
import { core } from "zod/v4";
|
|
4
|
+
|
|
5
|
+
//#region src/create/object.d.ts
|
|
6
|
+
declare const unwrapZodObject: (zodType: $ZodTypes, io: "input" | "output", path: string[]) => $ZodObject;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/zod.d.ts
|
|
9
|
+
declare const isAnyZodType: (schema: unknown) => schema is core.$ZodTypes;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ComponentRegistry, Override, createComponents, createRegistry, isAnyZodType, unwrapZodObject };
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const require_components = require('./components-Cp63fKGN.js');
|
|
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.mjs
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { createComponents,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
createMediaTypeObject,
|
|
5
|
-
createParameter,
|
|
6
|
-
createRegistry,
|
|
7
|
-
unwrapZodObject
|
|
8
|
-
};
|
|
1
|
+
import { createComponents, createRegistry, isAnyZodType, unwrapZodObject } from "./components-DKJ1Dtzd.mjs";
|
|
2
|
+
|
|
3
|
+
export { createComponents, createRegistry, isAnyZodType, unwrapZodObject };
|