zod-openapi 2.19.0-beta.0 → 2.19.0-beta.1
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/dist/index.d.mts +3 -120
- package/dist/index.d.ts +3 -120
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5,13 +5,6 @@ type IExtensionType = any;
|
|
|
5
5
|
type ISpecificationExtension = {
|
|
6
6
|
[extensionName: IExtensionName]: IExtensionType;
|
|
7
7
|
};
|
|
8
|
-
declare class SpecificationExtension implements ISpecificationExtension {
|
|
9
|
-
[extensionName: IExtensionName]: any;
|
|
10
|
-
static isValidExtension(extensionName: string): boolean;
|
|
11
|
-
getExtension(extensionName: string): any;
|
|
12
|
-
addExtension(extensionName: string, payload: any): void;
|
|
13
|
-
listExtensions(): string[];
|
|
14
|
-
}
|
|
15
8
|
|
|
16
9
|
interface ServerObject extends ISpecificationExtension {
|
|
17
10
|
url: string;
|
|
@@ -25,8 +18,6 @@ interface ServerVariableObject extends ISpecificationExtension {
|
|
|
25
18
|
default: string | boolean | number;
|
|
26
19
|
description?: string;
|
|
27
20
|
}
|
|
28
|
-
declare function getExtension(obj: ISpecificationExtension | undefined, extensionName: string): any;
|
|
29
|
-
declare function addExtension(obj: ISpecificationExtension | undefined, extensionName: string, extension: any): void;
|
|
30
21
|
|
|
31
22
|
interface OpenAPIObject$1 extends ISpecificationExtension {
|
|
32
23
|
openapi: string;
|
|
@@ -88,7 +79,6 @@ interface PathsObject$1 extends ISpecificationExtension {
|
|
|
88
79
|
[path: string]: PathItemObject$1;
|
|
89
80
|
}
|
|
90
81
|
type PathObject$1 = PathsObject$1;
|
|
91
|
-
declare function getPath$1(pathsObject: PathsObject$1, path: string): PathItemObject$1 | undefined;
|
|
92
82
|
interface PathItemObject$1 extends ISpecificationExtension {
|
|
93
83
|
$ref?: string;
|
|
94
84
|
summary?: string;
|
|
@@ -226,7 +216,6 @@ interface ExamplesObject$1 {
|
|
|
226
216
|
interface ReferenceObject$1 {
|
|
227
217
|
$ref: string;
|
|
228
218
|
}
|
|
229
|
-
declare function isReferenceObject$1(obj: any): obj is ReferenceObject$1;
|
|
230
219
|
type SchemaObjectType$1 = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array';
|
|
231
220
|
type SchemaObjectFormat = 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password' | string;
|
|
232
221
|
interface SchemaObject$2 extends ISpecificationExtension {
|
|
@@ -269,7 +258,6 @@ interface SchemaObject$2 extends ISpecificationExtension {
|
|
|
269
258
|
required?: string[];
|
|
270
259
|
enum?: any[];
|
|
271
260
|
}
|
|
272
|
-
declare function isSchemaObject$1(schema: SchemaObject$2 | ReferenceObject$1): schema is SchemaObject$2;
|
|
273
261
|
interface SchemasObject$1 {
|
|
274
262
|
[schema: string]: SchemaObject$2;
|
|
275
263
|
}
|
|
@@ -316,71 +304,14 @@ interface SecurityRequirementObject$1 {
|
|
|
316
304
|
[name: string]: string[];
|
|
317
305
|
}
|
|
318
306
|
|
|
319
|
-
declare class OpenApiBuilder$1 {
|
|
320
|
-
rootDoc: OpenAPIObject$1;
|
|
321
|
-
static create(doc?: OpenAPIObject$1): OpenApiBuilder$1;
|
|
322
|
-
constructor(doc?: OpenAPIObject$1);
|
|
323
|
-
getSpec(): OpenAPIObject$1;
|
|
324
|
-
getSpecAsJson(replacer?: (key: string, value: unknown) => unknown, space?: string | number): string;
|
|
325
|
-
getSpecAsYaml(): string;
|
|
326
|
-
private static isValidOpenApiVersion;
|
|
327
|
-
addOpenApiVersion(openApiVersion: string): OpenApiBuilder$1;
|
|
328
|
-
addInfo(info: InfoObject$1): OpenApiBuilder$1;
|
|
329
|
-
addContact(contact: ContactObject$1): OpenApiBuilder$1;
|
|
330
|
-
addLicense(license: LicenseObject$1): OpenApiBuilder$1;
|
|
331
|
-
addTitle(title: string): OpenApiBuilder$1;
|
|
332
|
-
addDescription(description: string): OpenApiBuilder$1;
|
|
333
|
-
addTermsOfService(termsOfService: string): OpenApiBuilder$1;
|
|
334
|
-
addVersion(version: string): OpenApiBuilder$1;
|
|
335
|
-
addPath(path: string, pathItem: PathItemObject$1): OpenApiBuilder$1;
|
|
336
|
-
addSchema(name: string, schema: SchemaObject$2 | ReferenceObject$1): OpenApiBuilder$1;
|
|
337
|
-
addResponse(name: string, response: ResponseObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
338
|
-
addParameter(name: string, parameter: ParameterObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
339
|
-
addExample(name: string, example: ExampleObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
340
|
-
addRequestBody(name: string, reqBody: RequestBodyObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
341
|
-
addHeader(name: string, header: HeaderObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
342
|
-
addSecurityScheme(name: string, secScheme: SecuritySchemeObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
343
|
-
addLink(name: string, link: LinkObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
344
|
-
addCallback(name: string, callback: CallbackObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
345
|
-
addServer(server: ServerObject): OpenApiBuilder$1;
|
|
346
|
-
addTag(tag: TagObject$1): OpenApiBuilder$1;
|
|
347
|
-
addExternalDocs(extDoc: ExternalDocumentationObject$1): OpenApiBuilder$1;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
declare class Server implements ServerObject {
|
|
351
|
-
url: string;
|
|
352
|
-
description?: string;
|
|
353
|
-
variables: {
|
|
354
|
-
[v: string]: ServerVariable;
|
|
355
|
-
};
|
|
356
|
-
[k: IExtensionName]: IExtensionType;
|
|
357
|
-
constructor(url: string, desc?: string);
|
|
358
|
-
addVariable(name: string, variable: ServerVariable): void;
|
|
359
|
-
}
|
|
360
|
-
declare class ServerVariable implements ServerVariableObject {
|
|
361
|
-
enum?: string[] | boolean[] | number[];
|
|
362
|
-
default: string | boolean | number;
|
|
363
|
-
description?: string;
|
|
364
|
-
[k: IExtensionName]: IExtensionType;
|
|
365
|
-
constructor(defaultValue: string | boolean | number, enums?: string[] | boolean[] | number[], description?: string);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
307
|
type oas30_IExtensionName = IExtensionName;
|
|
369
308
|
type oas30_IExtensionType = IExtensionType;
|
|
370
309
|
type oas30_ISpecificationExtension = ISpecificationExtension;
|
|
371
310
|
type oas30_SchemaObjectFormat = SchemaObjectFormat;
|
|
372
|
-
type oas30_Server = Server;
|
|
373
|
-
declare const oas30_Server: typeof Server;
|
|
374
311
|
type oas30_ServerObject = ServerObject;
|
|
375
|
-
type oas30_ServerVariable = ServerVariable;
|
|
376
|
-
declare const oas30_ServerVariable: typeof ServerVariable;
|
|
377
312
|
type oas30_ServerVariableObject = ServerVariableObject;
|
|
378
|
-
type oas30_SpecificationExtension = SpecificationExtension;
|
|
379
|
-
declare const oas30_SpecificationExtension: typeof SpecificationExtension;
|
|
380
|
-
declare const oas30_addExtension: typeof addExtension;
|
|
381
|
-
declare const oas30_getExtension: typeof getExtension;
|
|
382
313
|
declare namespace oas30 {
|
|
383
|
-
export {
|
|
314
|
+
export type { BaseParameterObject$1 as BaseParameterObject, CallbackObject$1 as CallbackObject, CallbacksObject$1 as CallbacksObject, ComponentsObject$2 as ComponentsObject, ContactObject$1 as ContactObject, ContentObject$1 as ContentObject, DiscriminatorObject$1 as DiscriminatorObject, EncodingObject$1 as EncodingObject, EncodingPropertyObject$1 as EncodingPropertyObject, ExampleObject$1 as ExampleObject, ExamplesObject$1 as ExamplesObject, ExternalDocumentationObject$1 as ExternalDocumentationObject, HeaderObject$1 as HeaderObject, HeadersObject$1 as HeadersObject, oas30_IExtensionName as IExtensionName, oas30_IExtensionType as IExtensionType, oas30_ISpecificationExtension as ISpecificationExtension, InfoObject$1 as InfoObject, LicenseObject$1 as LicenseObject, LinkObject$1 as LinkObject, LinkParametersObject$1 as LinkParametersObject, LinksObject$1 as LinksObject, MediaTypeObject$1 as MediaTypeObject, OAuthFlowObject$1 as OAuthFlowObject, OAuthFlowsObject$1 as OAuthFlowsObject, OpenAPIObject$1 as OpenAPIObject, OperationObject$1 as OperationObject, ParameterLocation$1 as ParameterLocation, ParameterObject$1 as ParameterObject, ParameterStyle$1 as ParameterStyle, PathItemObject$1 as PathItemObject, PathObject$1 as PathObject, PathsObject$1 as PathsObject, ReferenceObject$1 as ReferenceObject, RequestBodyObject$1 as RequestBodyObject, ResponseObject$1 as ResponseObject, ResponsesObject$1 as ResponsesObject, SchemaObject$2 as SchemaObject, oas30_SchemaObjectFormat as SchemaObjectFormat, SchemaObjectType$1 as SchemaObjectType, SchemasObject$1 as SchemasObject, ScopesObject$1 as ScopesObject, SecurityRequirementObject$1 as SecurityRequirementObject, SecuritySchemeObject$1 as SecuritySchemeObject, SecuritySchemeType$1 as SecuritySchemeType, oas30_ServerObject as ServerObject, oas30_ServerVariableObject as ServerVariableObject, TagObject$1 as TagObject, XmlObject$1 as XmlObject };
|
|
384
315
|
}
|
|
385
316
|
|
|
386
317
|
interface OpenAPIObject extends ISpecificationExtension {
|
|
@@ -445,7 +376,6 @@ interface PathsObject extends ISpecificationExtension {
|
|
|
445
376
|
[path: string]: PathItemObject;
|
|
446
377
|
}
|
|
447
378
|
type PathObject = PathsObject;
|
|
448
|
-
declare function getPath(pathsObject: PathsObject | undefined, path: string): PathItemObject | undefined;
|
|
449
379
|
interface PathItemObject extends ISpecificationExtension {
|
|
450
380
|
$ref?: string;
|
|
451
381
|
summary?: string;
|
|
@@ -585,7 +515,6 @@ interface ReferenceObject {
|
|
|
585
515
|
summary?: string;
|
|
586
516
|
description?: string;
|
|
587
517
|
}
|
|
588
|
-
declare function isReferenceObject(obj: any): obj is ReferenceObject;
|
|
589
518
|
type SchemaObjectType = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array';
|
|
590
519
|
interface SchemaObject$1 extends ISpecificationExtension {
|
|
591
520
|
discriminator?: DiscriminatorObject;
|
|
@@ -631,7 +560,6 @@ interface SchemaObject$1 extends ISpecificationExtension {
|
|
|
631
560
|
contentMediaType?: string;
|
|
632
561
|
contentEncoding?: string;
|
|
633
562
|
}
|
|
634
|
-
declare function isSchemaObject(schema: SchemaObject$1 | ReferenceObject): schema is SchemaObject$1;
|
|
635
563
|
interface SchemasObject {
|
|
636
564
|
[schema: string]: SchemaObject$1;
|
|
637
565
|
}
|
|
@@ -678,38 +606,6 @@ interface SecurityRequirementObject {
|
|
|
678
606
|
[name: string]: string[];
|
|
679
607
|
}
|
|
680
608
|
|
|
681
|
-
declare class OpenApiBuilder {
|
|
682
|
-
rootDoc: OpenAPIObject;
|
|
683
|
-
static create(doc?: OpenAPIObject): OpenApiBuilder;
|
|
684
|
-
constructor(doc?: OpenAPIObject);
|
|
685
|
-
getSpec(): OpenAPIObject;
|
|
686
|
-
getSpecAsJson(replacer?: (key: string, value: unknown) => unknown, space?: string | number): string;
|
|
687
|
-
getSpecAsYaml(): string;
|
|
688
|
-
private static isValidOpenApiVersion;
|
|
689
|
-
addOpenApiVersion(openApiVersion: string): OpenApiBuilder;
|
|
690
|
-
addInfo(info: InfoObject): OpenApiBuilder;
|
|
691
|
-
addContact(contact: ContactObject): OpenApiBuilder;
|
|
692
|
-
addLicense(license: LicenseObject): OpenApiBuilder;
|
|
693
|
-
addTitle(title: string): OpenApiBuilder;
|
|
694
|
-
addDescription(description: string): OpenApiBuilder;
|
|
695
|
-
addTermsOfService(termsOfService: string): OpenApiBuilder;
|
|
696
|
-
addVersion(version: string): OpenApiBuilder;
|
|
697
|
-
addPath(path: string, pathItem: PathItemObject): OpenApiBuilder;
|
|
698
|
-
addSchema(name: string, schema: SchemaObject$1 | ReferenceObject): OpenApiBuilder;
|
|
699
|
-
addResponse(name: string, response: ResponseObject | ReferenceObject): OpenApiBuilder;
|
|
700
|
-
addParameter(name: string, parameter: ParameterObject | ReferenceObject): OpenApiBuilder;
|
|
701
|
-
addExample(name: string, example: ExampleObject | ReferenceObject): OpenApiBuilder;
|
|
702
|
-
addRequestBody(name: string, reqBody: RequestBodyObject | ReferenceObject): OpenApiBuilder;
|
|
703
|
-
addHeader(name: string, header: HeaderObject | ReferenceObject): OpenApiBuilder;
|
|
704
|
-
addSecurityScheme(name: string, secScheme: SecuritySchemeObject | ReferenceObject): OpenApiBuilder;
|
|
705
|
-
addLink(name: string, link: LinkObject | ReferenceObject): OpenApiBuilder;
|
|
706
|
-
addCallback(name: string, callback: CallbackObject | ReferenceObject): OpenApiBuilder;
|
|
707
|
-
addServer(server: ServerObject): OpenApiBuilder;
|
|
708
|
-
addTag(tag: TagObject): OpenApiBuilder;
|
|
709
|
-
addExternalDocs(extDoc: ExternalDocumentationObject): OpenApiBuilder;
|
|
710
|
-
addWebhook(webhook: string, webhookItem: PathItemObject): OpenApiBuilder;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
609
|
type oas31_BaseParameterObject = BaseParameterObject;
|
|
714
610
|
type oas31_CallbackObject = CallbackObject;
|
|
715
611
|
type oas31_CallbacksObject = CallbacksObject;
|
|
@@ -735,8 +631,6 @@ type oas31_MediaTypeObject = MediaTypeObject;
|
|
|
735
631
|
type oas31_OAuthFlowObject = OAuthFlowObject;
|
|
736
632
|
type oas31_OAuthFlowsObject = OAuthFlowsObject;
|
|
737
633
|
type oas31_OpenAPIObject = OpenAPIObject;
|
|
738
|
-
type oas31_OpenApiBuilder = OpenApiBuilder;
|
|
739
|
-
declare const oas31_OpenApiBuilder: typeof OpenApiBuilder;
|
|
740
634
|
type oas31_OperationObject = OperationObject;
|
|
741
635
|
type oas31_ParameterLocation = ParameterLocation;
|
|
742
636
|
type oas31_ParameterObject = ParameterObject;
|
|
@@ -754,23 +648,12 @@ type oas31_ScopesObject = ScopesObject;
|
|
|
754
648
|
type oas31_SecurityRequirementObject = SecurityRequirementObject;
|
|
755
649
|
type oas31_SecuritySchemeObject = SecuritySchemeObject;
|
|
756
650
|
type oas31_SecuritySchemeType = SecuritySchemeType;
|
|
757
|
-
type oas31_Server = Server;
|
|
758
|
-
declare const oas31_Server: typeof Server;
|
|
759
651
|
type oas31_ServerObject = ServerObject;
|
|
760
|
-
type oas31_ServerVariable = ServerVariable;
|
|
761
|
-
declare const oas31_ServerVariable: typeof ServerVariable;
|
|
762
652
|
type oas31_ServerVariableObject = ServerVariableObject;
|
|
763
|
-
type oas31_SpecificationExtension = SpecificationExtension;
|
|
764
|
-
declare const oas31_SpecificationExtension: typeof SpecificationExtension;
|
|
765
653
|
type oas31_TagObject = TagObject;
|
|
766
654
|
type oas31_XmlObject = XmlObject;
|
|
767
|
-
declare const oas31_addExtension: typeof addExtension;
|
|
768
|
-
declare const oas31_getExtension: typeof getExtension;
|
|
769
|
-
declare const oas31_getPath: typeof getPath;
|
|
770
|
-
declare const oas31_isReferenceObject: typeof isReferenceObject;
|
|
771
|
-
declare const oas31_isSchemaObject: typeof isSchemaObject;
|
|
772
655
|
declare namespace oas31 {
|
|
773
|
-
export {
|
|
656
|
+
export type { oas31_BaseParameterObject as BaseParameterObject, oas31_CallbackObject as CallbackObject, oas31_CallbacksObject as CallbacksObject, ComponentsObject$1 as ComponentsObject, oas31_ContactObject as ContactObject, oas31_ContentObject as ContentObject, oas31_DiscriminatorObject as DiscriminatorObject, oas31_EncodingObject as EncodingObject, oas31_EncodingPropertyObject as EncodingPropertyObject, oas31_ExampleObject as ExampleObject, oas31_ExamplesObject as ExamplesObject, oas31_ExternalDocumentationObject as ExternalDocumentationObject, oas31_HeaderObject as HeaderObject, oas31_HeadersObject as HeadersObject, oas31_IExtensionName as IExtensionName, oas31_IExtensionType as IExtensionType, oas31_ISpecificationExtension as ISpecificationExtension, oas31_InfoObject as InfoObject, oas31_LicenseObject as LicenseObject, oas31_LinkObject as LinkObject, oas31_LinkParametersObject as LinkParametersObject, oas31_LinksObject as LinksObject, oas31_MediaTypeObject as MediaTypeObject, oas31_OAuthFlowObject as OAuthFlowObject, oas31_OAuthFlowsObject as OAuthFlowsObject, oas31_OpenAPIObject as OpenAPIObject, oas31_OperationObject as OperationObject, oas31_ParameterLocation as ParameterLocation, oas31_ParameterObject as ParameterObject, oas31_ParameterStyle as ParameterStyle, oas31_PathItemObject as PathItemObject, oas31_PathObject as PathObject, oas31_PathsObject as PathsObject, oas31_ReferenceObject as ReferenceObject, oas31_RequestBodyObject as RequestBodyObject, oas31_ResponseObject as ResponseObject, oas31_ResponsesObject as ResponsesObject, SchemaObject$1 as SchemaObject, oas31_SchemaObjectType as SchemaObjectType, oas31_SchemasObject as SchemasObject, oas31_ScopesObject as ScopesObject, oas31_SecurityRequirementObject as SecurityRequirementObject, oas31_SecuritySchemeObject as SecuritySchemeObject, oas31_SecuritySchemeType as SecuritySchemeType, oas31_ServerObject as ServerObject, oas31_ServerVariableObject as ServerVariableObject, oas31_TagObject as TagObject, oas31_XmlObject as XmlObject };
|
|
774
657
|
}
|
|
775
658
|
|
|
776
659
|
declare const openApiVersions: readonly ["3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.1.0"];
|
|
@@ -1052,4 +935,4 @@ declare namespace api {
|
|
|
1052
935
|
export { type api_ComponentsObject as ComponentsObject, api_createComponents as createComponents, api_createMediaTypeSchema as createMediaTypeSchema, api_createParamOrRef as createParamOrRef, api_getDefaultComponents as getDefaultComponents };
|
|
1053
936
|
}
|
|
1054
937
|
|
|
1055
|
-
export {
|
|
938
|
+
export { type ZodObjectInputType, type ZodOpenApiCallbackObject, type ZodOpenApiCallbacksObject, type ZodOpenApiComponentsObject, type ZodOpenApiContentObject, type ZodOpenApiMediaTypeObject, type ZodOpenApiObject, type ZodOpenApiOperationObject, type ZodOpenApiParameters, type ZodOpenApiPathItemObject, type ZodOpenApiPathsObject, type ZodOpenApiRequestBodyObject, type ZodOpenApiResponseObject, type ZodOpenApiResponsesObject, type ZodOpenApiVersion, api, createDocument, extendZodWithOpenApi, oas30, oas31 };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,13 +5,6 @@ type IExtensionType = any;
|
|
|
5
5
|
type ISpecificationExtension = {
|
|
6
6
|
[extensionName: IExtensionName]: IExtensionType;
|
|
7
7
|
};
|
|
8
|
-
declare class SpecificationExtension implements ISpecificationExtension {
|
|
9
|
-
[extensionName: IExtensionName]: any;
|
|
10
|
-
static isValidExtension(extensionName: string): boolean;
|
|
11
|
-
getExtension(extensionName: string): any;
|
|
12
|
-
addExtension(extensionName: string, payload: any): void;
|
|
13
|
-
listExtensions(): string[];
|
|
14
|
-
}
|
|
15
8
|
|
|
16
9
|
interface ServerObject extends ISpecificationExtension {
|
|
17
10
|
url: string;
|
|
@@ -25,8 +18,6 @@ interface ServerVariableObject extends ISpecificationExtension {
|
|
|
25
18
|
default: string | boolean | number;
|
|
26
19
|
description?: string;
|
|
27
20
|
}
|
|
28
|
-
declare function getExtension(obj: ISpecificationExtension | undefined, extensionName: string): any;
|
|
29
|
-
declare function addExtension(obj: ISpecificationExtension | undefined, extensionName: string, extension: any): void;
|
|
30
21
|
|
|
31
22
|
interface OpenAPIObject$1 extends ISpecificationExtension {
|
|
32
23
|
openapi: string;
|
|
@@ -88,7 +79,6 @@ interface PathsObject$1 extends ISpecificationExtension {
|
|
|
88
79
|
[path: string]: PathItemObject$1;
|
|
89
80
|
}
|
|
90
81
|
type PathObject$1 = PathsObject$1;
|
|
91
|
-
declare function getPath$1(pathsObject: PathsObject$1, path: string): PathItemObject$1 | undefined;
|
|
92
82
|
interface PathItemObject$1 extends ISpecificationExtension {
|
|
93
83
|
$ref?: string;
|
|
94
84
|
summary?: string;
|
|
@@ -226,7 +216,6 @@ interface ExamplesObject$1 {
|
|
|
226
216
|
interface ReferenceObject$1 {
|
|
227
217
|
$ref: string;
|
|
228
218
|
}
|
|
229
|
-
declare function isReferenceObject$1(obj: any): obj is ReferenceObject$1;
|
|
230
219
|
type SchemaObjectType$1 = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array';
|
|
231
220
|
type SchemaObjectFormat = 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password' | string;
|
|
232
221
|
interface SchemaObject$2 extends ISpecificationExtension {
|
|
@@ -269,7 +258,6 @@ interface SchemaObject$2 extends ISpecificationExtension {
|
|
|
269
258
|
required?: string[];
|
|
270
259
|
enum?: any[];
|
|
271
260
|
}
|
|
272
|
-
declare function isSchemaObject$1(schema: SchemaObject$2 | ReferenceObject$1): schema is SchemaObject$2;
|
|
273
261
|
interface SchemasObject$1 {
|
|
274
262
|
[schema: string]: SchemaObject$2;
|
|
275
263
|
}
|
|
@@ -316,71 +304,14 @@ interface SecurityRequirementObject$1 {
|
|
|
316
304
|
[name: string]: string[];
|
|
317
305
|
}
|
|
318
306
|
|
|
319
|
-
declare class OpenApiBuilder$1 {
|
|
320
|
-
rootDoc: OpenAPIObject$1;
|
|
321
|
-
static create(doc?: OpenAPIObject$1): OpenApiBuilder$1;
|
|
322
|
-
constructor(doc?: OpenAPIObject$1);
|
|
323
|
-
getSpec(): OpenAPIObject$1;
|
|
324
|
-
getSpecAsJson(replacer?: (key: string, value: unknown) => unknown, space?: string | number): string;
|
|
325
|
-
getSpecAsYaml(): string;
|
|
326
|
-
private static isValidOpenApiVersion;
|
|
327
|
-
addOpenApiVersion(openApiVersion: string): OpenApiBuilder$1;
|
|
328
|
-
addInfo(info: InfoObject$1): OpenApiBuilder$1;
|
|
329
|
-
addContact(contact: ContactObject$1): OpenApiBuilder$1;
|
|
330
|
-
addLicense(license: LicenseObject$1): OpenApiBuilder$1;
|
|
331
|
-
addTitle(title: string): OpenApiBuilder$1;
|
|
332
|
-
addDescription(description: string): OpenApiBuilder$1;
|
|
333
|
-
addTermsOfService(termsOfService: string): OpenApiBuilder$1;
|
|
334
|
-
addVersion(version: string): OpenApiBuilder$1;
|
|
335
|
-
addPath(path: string, pathItem: PathItemObject$1): OpenApiBuilder$1;
|
|
336
|
-
addSchema(name: string, schema: SchemaObject$2 | ReferenceObject$1): OpenApiBuilder$1;
|
|
337
|
-
addResponse(name: string, response: ResponseObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
338
|
-
addParameter(name: string, parameter: ParameterObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
339
|
-
addExample(name: string, example: ExampleObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
340
|
-
addRequestBody(name: string, reqBody: RequestBodyObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
341
|
-
addHeader(name: string, header: HeaderObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
342
|
-
addSecurityScheme(name: string, secScheme: SecuritySchemeObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
343
|
-
addLink(name: string, link: LinkObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
344
|
-
addCallback(name: string, callback: CallbackObject$1 | ReferenceObject$1): OpenApiBuilder$1;
|
|
345
|
-
addServer(server: ServerObject): OpenApiBuilder$1;
|
|
346
|
-
addTag(tag: TagObject$1): OpenApiBuilder$1;
|
|
347
|
-
addExternalDocs(extDoc: ExternalDocumentationObject$1): OpenApiBuilder$1;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
declare class Server implements ServerObject {
|
|
351
|
-
url: string;
|
|
352
|
-
description?: string;
|
|
353
|
-
variables: {
|
|
354
|
-
[v: string]: ServerVariable;
|
|
355
|
-
};
|
|
356
|
-
[k: IExtensionName]: IExtensionType;
|
|
357
|
-
constructor(url: string, desc?: string);
|
|
358
|
-
addVariable(name: string, variable: ServerVariable): void;
|
|
359
|
-
}
|
|
360
|
-
declare class ServerVariable implements ServerVariableObject {
|
|
361
|
-
enum?: string[] | boolean[] | number[];
|
|
362
|
-
default: string | boolean | number;
|
|
363
|
-
description?: string;
|
|
364
|
-
[k: IExtensionName]: IExtensionType;
|
|
365
|
-
constructor(defaultValue: string | boolean | number, enums?: string[] | boolean[] | number[], description?: string);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
307
|
type oas30_IExtensionName = IExtensionName;
|
|
369
308
|
type oas30_IExtensionType = IExtensionType;
|
|
370
309
|
type oas30_ISpecificationExtension = ISpecificationExtension;
|
|
371
310
|
type oas30_SchemaObjectFormat = SchemaObjectFormat;
|
|
372
|
-
type oas30_Server = Server;
|
|
373
|
-
declare const oas30_Server: typeof Server;
|
|
374
311
|
type oas30_ServerObject = ServerObject;
|
|
375
|
-
type oas30_ServerVariable = ServerVariable;
|
|
376
|
-
declare const oas30_ServerVariable: typeof ServerVariable;
|
|
377
312
|
type oas30_ServerVariableObject = ServerVariableObject;
|
|
378
|
-
type oas30_SpecificationExtension = SpecificationExtension;
|
|
379
|
-
declare const oas30_SpecificationExtension: typeof SpecificationExtension;
|
|
380
|
-
declare const oas30_addExtension: typeof addExtension;
|
|
381
|
-
declare const oas30_getExtension: typeof getExtension;
|
|
382
313
|
declare namespace oas30 {
|
|
383
|
-
export {
|
|
314
|
+
export type { BaseParameterObject$1 as BaseParameterObject, CallbackObject$1 as CallbackObject, CallbacksObject$1 as CallbacksObject, ComponentsObject$2 as ComponentsObject, ContactObject$1 as ContactObject, ContentObject$1 as ContentObject, DiscriminatorObject$1 as DiscriminatorObject, EncodingObject$1 as EncodingObject, EncodingPropertyObject$1 as EncodingPropertyObject, ExampleObject$1 as ExampleObject, ExamplesObject$1 as ExamplesObject, ExternalDocumentationObject$1 as ExternalDocumentationObject, HeaderObject$1 as HeaderObject, HeadersObject$1 as HeadersObject, oas30_IExtensionName as IExtensionName, oas30_IExtensionType as IExtensionType, oas30_ISpecificationExtension as ISpecificationExtension, InfoObject$1 as InfoObject, LicenseObject$1 as LicenseObject, LinkObject$1 as LinkObject, LinkParametersObject$1 as LinkParametersObject, LinksObject$1 as LinksObject, MediaTypeObject$1 as MediaTypeObject, OAuthFlowObject$1 as OAuthFlowObject, OAuthFlowsObject$1 as OAuthFlowsObject, OpenAPIObject$1 as OpenAPIObject, OperationObject$1 as OperationObject, ParameterLocation$1 as ParameterLocation, ParameterObject$1 as ParameterObject, ParameterStyle$1 as ParameterStyle, PathItemObject$1 as PathItemObject, PathObject$1 as PathObject, PathsObject$1 as PathsObject, ReferenceObject$1 as ReferenceObject, RequestBodyObject$1 as RequestBodyObject, ResponseObject$1 as ResponseObject, ResponsesObject$1 as ResponsesObject, SchemaObject$2 as SchemaObject, oas30_SchemaObjectFormat as SchemaObjectFormat, SchemaObjectType$1 as SchemaObjectType, SchemasObject$1 as SchemasObject, ScopesObject$1 as ScopesObject, SecurityRequirementObject$1 as SecurityRequirementObject, SecuritySchemeObject$1 as SecuritySchemeObject, SecuritySchemeType$1 as SecuritySchemeType, oas30_ServerObject as ServerObject, oas30_ServerVariableObject as ServerVariableObject, TagObject$1 as TagObject, XmlObject$1 as XmlObject };
|
|
384
315
|
}
|
|
385
316
|
|
|
386
317
|
interface OpenAPIObject extends ISpecificationExtension {
|
|
@@ -445,7 +376,6 @@ interface PathsObject extends ISpecificationExtension {
|
|
|
445
376
|
[path: string]: PathItemObject;
|
|
446
377
|
}
|
|
447
378
|
type PathObject = PathsObject;
|
|
448
|
-
declare function getPath(pathsObject: PathsObject | undefined, path: string): PathItemObject | undefined;
|
|
449
379
|
interface PathItemObject extends ISpecificationExtension {
|
|
450
380
|
$ref?: string;
|
|
451
381
|
summary?: string;
|
|
@@ -585,7 +515,6 @@ interface ReferenceObject {
|
|
|
585
515
|
summary?: string;
|
|
586
516
|
description?: string;
|
|
587
517
|
}
|
|
588
|
-
declare function isReferenceObject(obj: any): obj is ReferenceObject;
|
|
589
518
|
type SchemaObjectType = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array';
|
|
590
519
|
interface SchemaObject$1 extends ISpecificationExtension {
|
|
591
520
|
discriminator?: DiscriminatorObject;
|
|
@@ -631,7 +560,6 @@ interface SchemaObject$1 extends ISpecificationExtension {
|
|
|
631
560
|
contentMediaType?: string;
|
|
632
561
|
contentEncoding?: string;
|
|
633
562
|
}
|
|
634
|
-
declare function isSchemaObject(schema: SchemaObject$1 | ReferenceObject): schema is SchemaObject$1;
|
|
635
563
|
interface SchemasObject {
|
|
636
564
|
[schema: string]: SchemaObject$1;
|
|
637
565
|
}
|
|
@@ -678,38 +606,6 @@ interface SecurityRequirementObject {
|
|
|
678
606
|
[name: string]: string[];
|
|
679
607
|
}
|
|
680
608
|
|
|
681
|
-
declare class OpenApiBuilder {
|
|
682
|
-
rootDoc: OpenAPIObject;
|
|
683
|
-
static create(doc?: OpenAPIObject): OpenApiBuilder;
|
|
684
|
-
constructor(doc?: OpenAPIObject);
|
|
685
|
-
getSpec(): OpenAPIObject;
|
|
686
|
-
getSpecAsJson(replacer?: (key: string, value: unknown) => unknown, space?: string | number): string;
|
|
687
|
-
getSpecAsYaml(): string;
|
|
688
|
-
private static isValidOpenApiVersion;
|
|
689
|
-
addOpenApiVersion(openApiVersion: string): OpenApiBuilder;
|
|
690
|
-
addInfo(info: InfoObject): OpenApiBuilder;
|
|
691
|
-
addContact(contact: ContactObject): OpenApiBuilder;
|
|
692
|
-
addLicense(license: LicenseObject): OpenApiBuilder;
|
|
693
|
-
addTitle(title: string): OpenApiBuilder;
|
|
694
|
-
addDescription(description: string): OpenApiBuilder;
|
|
695
|
-
addTermsOfService(termsOfService: string): OpenApiBuilder;
|
|
696
|
-
addVersion(version: string): OpenApiBuilder;
|
|
697
|
-
addPath(path: string, pathItem: PathItemObject): OpenApiBuilder;
|
|
698
|
-
addSchema(name: string, schema: SchemaObject$1 | ReferenceObject): OpenApiBuilder;
|
|
699
|
-
addResponse(name: string, response: ResponseObject | ReferenceObject): OpenApiBuilder;
|
|
700
|
-
addParameter(name: string, parameter: ParameterObject | ReferenceObject): OpenApiBuilder;
|
|
701
|
-
addExample(name: string, example: ExampleObject | ReferenceObject): OpenApiBuilder;
|
|
702
|
-
addRequestBody(name: string, reqBody: RequestBodyObject | ReferenceObject): OpenApiBuilder;
|
|
703
|
-
addHeader(name: string, header: HeaderObject | ReferenceObject): OpenApiBuilder;
|
|
704
|
-
addSecurityScheme(name: string, secScheme: SecuritySchemeObject | ReferenceObject): OpenApiBuilder;
|
|
705
|
-
addLink(name: string, link: LinkObject | ReferenceObject): OpenApiBuilder;
|
|
706
|
-
addCallback(name: string, callback: CallbackObject | ReferenceObject): OpenApiBuilder;
|
|
707
|
-
addServer(server: ServerObject): OpenApiBuilder;
|
|
708
|
-
addTag(tag: TagObject): OpenApiBuilder;
|
|
709
|
-
addExternalDocs(extDoc: ExternalDocumentationObject): OpenApiBuilder;
|
|
710
|
-
addWebhook(webhook: string, webhookItem: PathItemObject): OpenApiBuilder;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
609
|
type oas31_BaseParameterObject = BaseParameterObject;
|
|
714
610
|
type oas31_CallbackObject = CallbackObject;
|
|
715
611
|
type oas31_CallbacksObject = CallbacksObject;
|
|
@@ -735,8 +631,6 @@ type oas31_MediaTypeObject = MediaTypeObject;
|
|
|
735
631
|
type oas31_OAuthFlowObject = OAuthFlowObject;
|
|
736
632
|
type oas31_OAuthFlowsObject = OAuthFlowsObject;
|
|
737
633
|
type oas31_OpenAPIObject = OpenAPIObject;
|
|
738
|
-
type oas31_OpenApiBuilder = OpenApiBuilder;
|
|
739
|
-
declare const oas31_OpenApiBuilder: typeof OpenApiBuilder;
|
|
740
634
|
type oas31_OperationObject = OperationObject;
|
|
741
635
|
type oas31_ParameterLocation = ParameterLocation;
|
|
742
636
|
type oas31_ParameterObject = ParameterObject;
|
|
@@ -754,23 +648,12 @@ type oas31_ScopesObject = ScopesObject;
|
|
|
754
648
|
type oas31_SecurityRequirementObject = SecurityRequirementObject;
|
|
755
649
|
type oas31_SecuritySchemeObject = SecuritySchemeObject;
|
|
756
650
|
type oas31_SecuritySchemeType = SecuritySchemeType;
|
|
757
|
-
type oas31_Server = Server;
|
|
758
|
-
declare const oas31_Server: typeof Server;
|
|
759
651
|
type oas31_ServerObject = ServerObject;
|
|
760
|
-
type oas31_ServerVariable = ServerVariable;
|
|
761
|
-
declare const oas31_ServerVariable: typeof ServerVariable;
|
|
762
652
|
type oas31_ServerVariableObject = ServerVariableObject;
|
|
763
|
-
type oas31_SpecificationExtension = SpecificationExtension;
|
|
764
|
-
declare const oas31_SpecificationExtension: typeof SpecificationExtension;
|
|
765
653
|
type oas31_TagObject = TagObject;
|
|
766
654
|
type oas31_XmlObject = XmlObject;
|
|
767
|
-
declare const oas31_addExtension: typeof addExtension;
|
|
768
|
-
declare const oas31_getExtension: typeof getExtension;
|
|
769
|
-
declare const oas31_getPath: typeof getPath;
|
|
770
|
-
declare const oas31_isReferenceObject: typeof isReferenceObject;
|
|
771
|
-
declare const oas31_isSchemaObject: typeof isSchemaObject;
|
|
772
655
|
declare namespace oas31 {
|
|
773
|
-
export {
|
|
656
|
+
export type { oas31_BaseParameterObject as BaseParameterObject, oas31_CallbackObject as CallbackObject, oas31_CallbacksObject as CallbacksObject, ComponentsObject$1 as ComponentsObject, oas31_ContactObject as ContactObject, oas31_ContentObject as ContentObject, oas31_DiscriminatorObject as DiscriminatorObject, oas31_EncodingObject as EncodingObject, oas31_EncodingPropertyObject as EncodingPropertyObject, oas31_ExampleObject as ExampleObject, oas31_ExamplesObject as ExamplesObject, oas31_ExternalDocumentationObject as ExternalDocumentationObject, oas31_HeaderObject as HeaderObject, oas31_HeadersObject as HeadersObject, oas31_IExtensionName as IExtensionName, oas31_IExtensionType as IExtensionType, oas31_ISpecificationExtension as ISpecificationExtension, oas31_InfoObject as InfoObject, oas31_LicenseObject as LicenseObject, oas31_LinkObject as LinkObject, oas31_LinkParametersObject as LinkParametersObject, oas31_LinksObject as LinksObject, oas31_MediaTypeObject as MediaTypeObject, oas31_OAuthFlowObject as OAuthFlowObject, oas31_OAuthFlowsObject as OAuthFlowsObject, oas31_OpenAPIObject as OpenAPIObject, oas31_OperationObject as OperationObject, oas31_ParameterLocation as ParameterLocation, oas31_ParameterObject as ParameterObject, oas31_ParameterStyle as ParameterStyle, oas31_PathItemObject as PathItemObject, oas31_PathObject as PathObject, oas31_PathsObject as PathsObject, oas31_ReferenceObject as ReferenceObject, oas31_RequestBodyObject as RequestBodyObject, oas31_ResponseObject as ResponseObject, oas31_ResponsesObject as ResponsesObject, SchemaObject$1 as SchemaObject, oas31_SchemaObjectType as SchemaObjectType, oas31_SchemasObject as SchemasObject, oas31_ScopesObject as ScopesObject, oas31_SecurityRequirementObject as SecurityRequirementObject, oas31_SecuritySchemeObject as SecuritySchemeObject, oas31_SecuritySchemeType as SecuritySchemeType, oas31_ServerObject as ServerObject, oas31_ServerVariableObject as ServerVariableObject, oas31_TagObject as TagObject, oas31_XmlObject as XmlObject };
|
|
774
657
|
}
|
|
775
658
|
|
|
776
659
|
declare const openApiVersions: readonly ["3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.1.0"];
|
|
@@ -1052,4 +935,4 @@ declare namespace api {
|
|
|
1052
935
|
export { type api_ComponentsObject as ComponentsObject, api_createComponents as createComponents, api_createMediaTypeSchema as createMediaTypeSchema, api_createParamOrRef as createParamOrRef, api_getDefaultComponents as getDefaultComponents };
|
|
1053
936
|
}
|
|
1054
937
|
|
|
1055
|
-
export {
|
|
938
|
+
export { type ZodObjectInputType, type ZodOpenApiCallbackObject, type ZodOpenApiCallbacksObject, type ZodOpenApiComponentsObject, type ZodOpenApiContentObject, type ZodOpenApiMediaTypeObject, type ZodOpenApiObject, type ZodOpenApiOperationObject, type ZodOpenApiParameters, type ZodOpenApiPathItemObject, type ZodOpenApiPathsObject, type ZodOpenApiRequestBodyObject, type ZodOpenApiResponseObject, type ZodOpenApiResponsesObject, type ZodOpenApiVersion, api, createDocument, extendZodWithOpenApi, oas30, oas31 };
|