zod-openapi 5.0.0-beta.3 → 5.0.0-beta.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/README.md +207 -70
- package/dist/api.cjs +4 -4
- package/dist/api.d.mts +3 -5
- package/dist/api.d.ts +3 -5
- package/dist/api.mjs +5 -5
- package/dist/components.chunk.cjs +2304 -864
- package/dist/components.chunk.mjs +2294 -854
- package/dist/create/components.d.ts +121 -61
- package/dist/create/content.d.ts +6 -8
- package/dist/create/document.d.ts +32 -38
- package/dist/create/parameters.d.ts +7 -12
- package/dist/create/schema/single.d.ts +33 -0
- package/dist/extend.cjs +4 -0
- package/dist/extend.d.mts +1 -0
- package/dist/extend.d.ts +1 -0
- package/dist/extend.mjs +3 -0
- package/dist/extendZod.chunk.cjs +95 -0
- package/dist/extendZod.chunk.mjs +96 -0
- package/dist/extendZod.d.ts +6 -0
- package/dist/extendZodSymbols.chunk.cjs +5 -0
- package/dist/extendZodSymbols.chunk.mjs +6 -0
- package/dist/extendZodSymbols.d.ts +4 -0
- package/dist/extendZodTypes.d.ts +91 -0
- package/dist/index.cjs +55 -18
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.mjs +56 -20
- package/dist/openapi.d.ts +1 -1
- package/dist/openapi3-ts/dist/model/openapi30.d.ts +291 -0
- package/dist/openapi3-ts/dist/model/openapi31.d.ts +0 -4
- package/dist/openapi3-ts/dist/oas30.d.ts +3 -0
- package/dist/openapi3-ts/{oas31.d.ts → dist/oas31.d.ts} +3 -3
- package/extend/index.d.ts +1 -0
- package/extend/package.json +5 -0
- package/package.json +5 -5
- package/dist/create/object.d.ts +0 -5
- package/dist/create/schema/schema.d.ts +0 -21
- package/dist/zod.d.ts +0 -49
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { core } from 'zod/v4';
|
|
2
|
-
import { CreateDocumentOptions } from '../document.js';
|
|
3
|
-
import { ComponentRegistry } from '../components.js';
|
|
4
|
-
import '../../zod.js';
|
|
5
|
-
import { SchemaObject, ReferenceObject } from '../../openapi3-ts/dist/model/openapi31.js';
|
|
6
|
-
|
|
7
|
-
interface SchemaResult {
|
|
8
|
-
schema: SchemaObject | ReferenceObject;
|
|
9
|
-
components: Record<string, SchemaObject>;
|
|
10
|
-
}
|
|
11
|
-
declare const createSchema: (schema: core.$ZodType, ctx?: {
|
|
12
|
-
registry?: ComponentRegistry;
|
|
13
|
-
io?: "input" | "output";
|
|
14
|
-
opts?: CreateDocumentOptions;
|
|
15
|
-
}) => {
|
|
16
|
-
schema: SchemaObject | ReferenceObject;
|
|
17
|
-
components: Record<string, SchemaObject>;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { createSchema };
|
|
21
|
-
export type { SchemaResult };
|
package/dist/zod.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { core } from 'zod/v4';
|
|
2
|
-
import { ParameterObject, HeaderObject, SchemaObject } from './openapi3-ts/dist/model/openapi31.js';
|
|
3
|
-
|
|
4
|
-
type Override = (ctx: {
|
|
5
|
-
zodSchema: core.$ZodTypes;
|
|
6
|
-
jsonSchema: core.JSONSchema.BaseSchema;
|
|
7
|
-
io: 'input' | 'output';
|
|
8
|
-
}) => void;
|
|
9
|
-
declare const isAnyZodType: (schema: unknown) => schema is core.$ZodTypes;
|
|
10
|
-
declare module 'zod/v4' {
|
|
11
|
-
interface GlobalMeta {
|
|
12
|
-
/**
|
|
13
|
-
* Used to set metadata for a parameter
|
|
14
|
-
*/
|
|
15
|
-
param?: Partial<ParameterObject> & {
|
|
16
|
-
/**
|
|
17
|
-
* Used to output this Zod Schema in the components parameters section. Any usage of this Zod Schema will then be transformed into a $ref.
|
|
18
|
-
*/
|
|
19
|
-
id?: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Used to set metadata for a response header
|
|
23
|
-
*/
|
|
24
|
-
header?: Partial<HeaderObject> & {
|
|
25
|
-
/**
|
|
26
|
-
* Used to output this Zod Schema in the components headers section. Any usage of this Zod Schema will then be transformed into a $ref.
|
|
27
|
-
*/
|
|
28
|
-
id?: string;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Use to override the rendered schema
|
|
32
|
-
*/
|
|
33
|
-
override?: SchemaObject | Override;
|
|
34
|
-
/**
|
|
35
|
-
* For use only if this Zod Schema is manually registered in the `components` section
|
|
36
|
-
* and is not used anywhere else in the document.
|
|
37
|
-
* Defaults to `output` if not specified.
|
|
38
|
-
*/
|
|
39
|
-
unusedIO?: 'input' | 'output';
|
|
40
|
-
/**
|
|
41
|
-
* An alternate id to use for this schema in the event the schema is used in both input and output contexts.
|
|
42
|
-
* If not specified, the id will be simply derived as the id of the schema plus an `Output` suffix. Please note that `id` must be set.
|
|
43
|
-
*/
|
|
44
|
-
outputId?: string;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export { isAnyZodType };
|
|
49
|
-
export type { Override };
|