zod-openapi 2.7.3 → 2.8.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 +2 -1
- package/lib-commonjs/create/components.js +7 -7
- package/lib-commonjs/create/components.js.map +1 -1
- package/lib-commonjs/create/content.js +2 -2
- package/lib-commonjs/create/content.js.map +1 -1
- package/lib-commonjs/create/parameters.js +2 -2
- package/lib-commonjs/create/parameters.js.map +1 -1
- package/lib-commonjs/create/responses.js +2 -2
- package/lib-commonjs/create/responses.js.map +1 -1
- package/lib-commonjs/create/schema/parsers/discriminatedUnion.js +2 -2
- package/lib-commonjs/create/schema/parsers/discriminatedUnion.js.map +1 -1
- package/lib-commonjs/create/schema/parsers/index.js +33 -29
- package/lib-commonjs/create/schema/parsers/index.js.map +1 -1
- package/lib-commonjs/create/schema/parsers/manual.js +2 -2
- package/lib-commonjs/create/schema/parsers/manual.js.map +1 -1
- package/lib-commonjs/create/schema/parsers/nativeEnum.js.map +1 -1
- package/lib-commonjs/create/schema/parsers/object.js +3 -3
- package/lib-commonjs/create/schema/parsers/object.js.map +1 -1
- package/lib-commonjs/create/schema/parsers/optional.js +10 -9
- package/lib-commonjs/create/schema/parsers/optional.js.map +1 -1
- package/lib-commonjs/create/schema/parsers/readonly.js +10 -0
- package/lib-commonjs/create/schema/parsers/readonly.js.map +1 -0
- package/lib-commonjs/zodType.js +9 -0
- package/lib-commonjs/zodType.js.map +1 -0
- package/lib-es2015/create/components.js +7 -7
- package/lib-es2015/create/components.js.map +1 -1
- package/lib-es2015/create/content.js +2 -2
- package/lib-es2015/create/content.js.map +1 -1
- package/lib-es2015/create/parameters.js +2 -2
- package/lib-es2015/create/parameters.js.map +1 -1
- package/lib-es2015/create/responses.js +2 -2
- package/lib-es2015/create/responses.js.map +1 -1
- package/lib-es2015/create/schema/parsers/discriminatedUnion.js +2 -2
- package/lib-es2015/create/schema/parsers/discriminatedUnion.js.map +1 -1
- package/lib-es2015/create/schema/parsers/index.js +33 -29
- package/lib-es2015/create/schema/parsers/index.js.map +1 -1
- package/lib-es2015/create/schema/parsers/manual.js +2 -2
- package/lib-es2015/create/schema/parsers/manual.js.map +1 -1
- package/lib-es2015/create/schema/parsers/nativeEnum.js.map +1 -1
- package/lib-es2015/create/schema/parsers/object.js +3 -3
- package/lib-es2015/create/schema/parsers/object.js.map +1 -1
- package/lib-es2015/create/schema/parsers/optional.js +10 -9
- package/lib-es2015/create/schema/parsers/optional.js.map +1 -1
- package/lib-es2015/create/schema/parsers/readonly.js +6 -0
- package/lib-es2015/create/schema/parsers/readonly.js.map +1 -0
- package/lib-es2015/zodType.js +4 -0
- package/lib-es2015/zodType.js.map +1 -0
- package/lib-types/create/components.d.ts +1 -1
- package/lib-types/create/content.d.ts +1 -1
- package/lib-types/create/parameters.d.ts +1 -1
- package/lib-types/create/responses.d.ts +1 -1
- package/lib-types/create/schema/parsers/discriminatedUnion.d.ts +1 -1
- package/lib-types/create/schema/parsers/index.d.ts +1 -1
- package/lib-types/create/schema/parsers/manual.d.ts +1 -1
- package/lib-types/create/schema/parsers/object.d.ts +1 -1
- package/lib-types/create/schema/parsers/optional.d.ts +1 -1
- package/lib-types/create/schema/parsers/readonly.d.ts +4 -0
- package/lib-types/zodType.d.ts +42 -0
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ZodType, ZodTypeDef } from 'zod';
|
|
2
2
|
import type { oas31 } from '../../../openapi3-ts/dist';
|
|
3
3
|
import type { SchemaState } from '../../schema';
|
|
4
4
|
export declare const createSchemaSwitch: <Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output>(zodSchema: ZodType<Output, Def, Input>, state: SchemaState) => oas31.SchemaObject | oas31.ReferenceObject;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ZodType, ZodTypeDef } from 'zod';
|
|
2
2
|
import type { oas31 } from '../../../openapi3-ts/dist';
|
|
3
3
|
import type { SchemaState } from '../../schema';
|
|
4
4
|
export declare const createManualTypeSchema: <Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output>(zodSchema: ZodType<Output, Def, Input>, state: SchemaState) => oas31.SchemaObject;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { UnknownKeysParam, ZodObject, ZodRawShape, ZodType } from 'zod';
|
|
2
2
|
import type { oas31 } from '../../../openapi3-ts/dist';
|
|
3
3
|
import { type SchemaState } from '../../schema';
|
|
4
4
|
export declare const createObjectSchema: <T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam>(zodObject: ZodObject<T, UnknownKeys, any, any, any>, state: SchemaState) => oas31.SchemaObject;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ZodOptional,
|
|
1
|
+
import type { ZodOptional, ZodTypeAny } from 'zod';
|
|
2
2
|
import type { oas31 } from '../../../openapi3-ts/dist';
|
|
3
3
|
import { type SchemaState } from '../../schema';
|
|
4
4
|
export declare const createOptionalSchema: (zodOptional: ZodOptional<any>, state: SchemaState) => oas31.SchemaObject | oas31.ReferenceObject;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ZodReadonly } from 'zod';
|
|
2
|
+
import type { oas31 } from '../../../openapi3-ts/dist';
|
|
3
|
+
import { type SchemaState } from '../../schema';
|
|
4
|
+
export declare const createReadonlySchema: (zodReadonly: ZodReadonly<any>, state: SchemaState) => oas31.SchemaObject | oas31.ReferenceObject;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodFunction, ZodIntersection, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodSet, ZodString, ZodSymbol, ZodTuple, ZodType, ZodTypeDef, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid } from 'zod';
|
|
2
|
+
type ZodTypeMap = {
|
|
3
|
+
ZodAny: ZodAny;
|
|
4
|
+
ZodArray: ZodArray<any>;
|
|
5
|
+
ZodBigInt: ZodBigInt;
|
|
6
|
+
ZodBoolean: ZodBoolean;
|
|
7
|
+
ZodBranded: ZodBranded<any, any>;
|
|
8
|
+
ZodCatch: ZodCatch<any>;
|
|
9
|
+
ZodDate: ZodDate;
|
|
10
|
+
ZodDefault: ZodDefault<any>;
|
|
11
|
+
ZodDiscriminatedUnion: ZodDiscriminatedUnion<any, any>;
|
|
12
|
+
ZodEffects: ZodEffects<any>;
|
|
13
|
+
ZodEnum: ZodEnum<any>;
|
|
14
|
+
ZodFunction: ZodFunction<any, any>;
|
|
15
|
+
ZodIntersection: ZodIntersection<any, any>;
|
|
16
|
+
ZodLazy: ZodLazy<any>;
|
|
17
|
+
ZodLiteral: ZodLiteral<any>;
|
|
18
|
+
ZodMap: ZodMap;
|
|
19
|
+
ZodNaN: ZodNaN;
|
|
20
|
+
ZodNativeEnum: ZodNativeEnum<any>;
|
|
21
|
+
ZodNever: ZodNever;
|
|
22
|
+
ZodNull: ZodNull;
|
|
23
|
+
ZodNullable: ZodNullable<any>;
|
|
24
|
+
ZodNumber: ZodNumber;
|
|
25
|
+
ZodObject: ZodObject<any>;
|
|
26
|
+
ZodOptional: ZodOptional<any>;
|
|
27
|
+
ZodPipeline: ZodPipeline<any, any>;
|
|
28
|
+
ZodPromise: ZodPromise<any>;
|
|
29
|
+
ZodReadonly: ZodReadonly<any>;
|
|
30
|
+
ZodRecord: ZodRecord;
|
|
31
|
+
ZodSet: ZodSet;
|
|
32
|
+
ZodString: ZodString;
|
|
33
|
+
ZodSymbol: ZodSymbol;
|
|
34
|
+
ZodTuple: ZodTuple;
|
|
35
|
+
ZodUndefined: ZodUndefined;
|
|
36
|
+
ZodUnion: ZodUnion<any>;
|
|
37
|
+
ZodUnknown: ZodUnknown;
|
|
38
|
+
ZodVoid: ZodVoid;
|
|
39
|
+
};
|
|
40
|
+
export declare const isZodType: <U extends keyof ZodTypeMap>(zodType: unknown, typeName: U) => zodType is ZodTypeMap[U];
|
|
41
|
+
export declare const isAnyZodType: (zodType: unknown) => zodType is ZodType<any, ZodTypeDef, any>;
|
|
42
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod-openapi",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Convert Zod Schemas to OpenAPI v3.x documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@redocly/cli": "1.0.
|
|
46
|
+
"@redocly/cli": "1.0.2",
|
|
47
47
|
"@types/node": "^20.3.0",
|
|
48
48
|
"eslint-plugin-zod-openapi": "^0.1.0",
|
|
49
49
|
"openapi3-ts": "4.1.2",
|
|
50
|
-
"skuba": "
|
|
50
|
+
"skuba": "7.0.1",
|
|
51
51
|
"yaml": "2.3.1",
|
|
52
|
-
"zod": "3.
|
|
52
|
+
"zod": "3.22.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"zod": "^3.21.4"
|