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 CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="zod-openapi.svg" width="200px" align="center" alt="zod-openapi logo" />
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/badge/node-%3E%3D%2018-brightgreen"/></a>
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 "../dist/api";
1
+ export * from '../dist/api';
package/dist/api.d.mts CHANGED
@@ -1,5 +1,11 @@
1
- export { createComponents, createRegistry } from './create/components.js';
2
- export { createMediaTypeObject } from './create/content.js';
3
- export { createParameter } from './create/parameters.js';
4
- export { unwrapZodObject } from './create/object.js';
5
- export { Override, isAnyZodType } from './zod.js';
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
- export { createComponents, createRegistry } from './create/components.js';
2
- export { createMediaTypeObject } from './create/content.js';
3
- export { createParameter } from './create/parameters.js';
4
- export { unwrapZodObject } from './create/object.js';
5
- export { Override, isAnyZodType } from './zod.js';
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, createMediaTypeObject, createParameter, createRegistry, unwrapZodObject } from "./components.chunk.mjs";
2
- export {
3
- createComponents,
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 };