zod-openapi 2.7.2 → 2.7.4
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/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/index.js +16 -8
- package/lib-commonjs/create/schema/index.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 +29 -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/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/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/index.js +16 -8
- package/lib-es2015/create/schema/index.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 +29 -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/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/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/index.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/zodType.d.ts +41 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AnyZodObject, ZodType } from 'zod';
|
|
2
2
|
import type { oas30, oas31 } from '../openapi3-ts/dist';
|
|
3
3
|
import { type ComponentsObject } from './components';
|
|
4
4
|
import type { ZodOpenApiResponseObject, ZodOpenApiResponsesObject } from './document';
|
|
@@ -12,7 +12,7 @@ export interface SchemaState {
|
|
|
12
12
|
export declare const newSchemaState: (state: SchemaState) => SchemaState;
|
|
13
13
|
export declare const createNewSchema: <Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output>(zodSchema: ZodType<Output, Def, Input>, newState: SchemaState, subpath: string[]) => Schema;
|
|
14
14
|
export declare const createNewRef: <Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output>(ref: string, zodSchema: ZodType<Output, Def, Input>, state: SchemaState, subpath: string[]) => Schema;
|
|
15
|
-
export declare const createExistingRef: (component: SchemaComponent | undefined, state: SchemaState, subpath: string[]) => Schema | undefined;
|
|
15
|
+
export declare const createExistingRef: <Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output>(zodSchema: ZodType<Output, Def, Input>, component: SchemaComponent | undefined, state: SchemaState, subpath: string[]) => Schema | undefined;
|
|
16
16
|
type Schema = {
|
|
17
17
|
schema: oas31.ReferenceObject | oas31.SchemaObject;
|
|
18
18
|
newState: SchemaState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AnyZodObject, ZodDiscriminatedUnion } from 'zod';
|
|
2
2
|
import type { oas31 } from '../../../openapi3-ts/dist';
|
|
3
3
|
import { type SchemaState } from '../../schema';
|
|
4
4
|
export declare const createDiscriminatedUnionSchema: (zodDiscriminatedUnion: ZodDiscriminatedUnion<any, any>, state: SchemaState) => oas31.SchemaObject;
|
|
@@ -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,41 @@
|
|
|
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, 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
|
+
ZodRecord: ZodRecord;
|
|
30
|
+
ZodSet: ZodSet;
|
|
31
|
+
ZodString: ZodString;
|
|
32
|
+
ZodSymbol: ZodSymbol;
|
|
33
|
+
ZodTuple: ZodTuple;
|
|
34
|
+
ZodUndefined: ZodUndefined;
|
|
35
|
+
ZodUnion: ZodUnion<any>;
|
|
36
|
+
ZodUnknown: ZodUnknown;
|
|
37
|
+
ZodVoid: ZodVoid;
|
|
38
|
+
};
|
|
39
|
+
export declare const isZodType: <U extends keyof ZodTypeMap>(zodType: unknown, typeName: U) => zodType is ZodTypeMap[U];
|
|
40
|
+
export declare const isAnyZodType: (zodType: unknown) => zodType is ZodType<any, ZodTypeDef, any>;
|
|
41
|
+
export {};
|