1 | export interface OpenAPIObject {
|
2 | openapi: string;
|
3 | info: InfoObject;
|
4 | servers?: ServerObject[];
|
5 | paths: PathsObject;
|
6 | components?: ComponentsObject;
|
7 | security?: SecurityRequirementObject[];
|
8 | tags?: TagObject[];
|
9 | externalDocs?: ExternalDocumentationObject;
|
10 | }
|
11 | export interface InfoObject {
|
12 | title: string;
|
13 | description?: string;
|
14 | termsOfService?: string;
|
15 | contact?: ContactObject;
|
16 | license?: LicenseObject;
|
17 | version: string;
|
18 | }
|
19 | export interface ContactObject {
|
20 | name?: string;
|
21 | url?: string;
|
22 | email?: string;
|
23 | }
|
24 | export interface LicenseObject {
|
25 | name: string;
|
26 | url?: string;
|
27 | }
|
28 | export interface ServerObject {
|
29 | url: string;
|
30 | description?: string;
|
31 | variables?: Record<string, ServerVariableObject>;
|
32 | }
|
33 | export interface ServerVariableObject {
|
34 | enum?: string[] | boolean[] | number[];
|
35 | default: string | boolean | number;
|
36 | description?: string;
|
37 | }
|
38 | export interface ComponentsObject {
|
39 | schemas?: Record<string, SchemaObject | ReferenceObject>;
|
40 | responses?: Record<string, ResponseObject | ReferenceObject>;
|
41 | parameters?: Record<string, ParameterObject | ReferenceObject>;
|
42 | examples?: Record<string, ExampleObject | ReferenceObject>;
|
43 | requestBodies?: Record<string, RequestBodyObject | ReferenceObject>;
|
44 | headers?: Record<string, HeaderObject | ReferenceObject>;
|
45 | securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
|
46 | links?: Record<string, LinkObject | ReferenceObject>;
|
47 | callbacks?: Record<string, CallbackObject | ReferenceObject>;
|
48 | }
|
49 | export type PathsObject = Record<string, PathItemObject>;
|
50 | export interface PathItemObject {
|
51 | $ref?: string;
|
52 | summary?: string;
|
53 | description?: string;
|
54 | get?: OperationObject;
|
55 | put?: OperationObject;
|
56 | post?: OperationObject;
|
57 | delete?: OperationObject;
|
58 | options?: OperationObject;
|
59 | head?: OperationObject;
|
60 | patch?: OperationObject;
|
61 | trace?: OperationObject;
|
62 | servers?: ServerObject[];
|
63 | parameters?: (ParameterObject | ReferenceObject)[];
|
64 | }
|
65 | export interface OperationObject {
|
66 | tags?: string[];
|
67 | summary?: string;
|
68 | description?: string;
|
69 | externalDocs?: ExternalDocumentationObject;
|
70 | operationId?: string;
|
71 | parameters?: (ParameterObject | ReferenceObject)[];
|
72 | requestBody?: RequestBodyObject | ReferenceObject;
|
73 | responses: ResponsesObject;
|
74 | callbacks?: CallbacksObject;
|
75 | deprecated?: boolean;
|
76 | security?: SecurityRequirementObject[];
|
77 | servers?: ServerObject[];
|
78 | }
|
79 | export interface ExternalDocumentationObject {
|
80 | description?: string;
|
81 | url: string;
|
82 | }
|
83 | export type ParameterLocation = 'query' | 'header' | 'path' | 'cookie';
|
84 | export type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
|
85 | export interface BaseParameterObject {
|
86 | description?: string;
|
87 | required?: boolean;
|
88 | deprecated?: boolean;
|
89 | allowEmptyValue?: boolean;
|
90 | style?: ParameterStyle;
|
91 | explode?: boolean;
|
92 | allowReserved?: boolean;
|
93 | schema?: SchemaObject | ReferenceObject;
|
94 | examples?: Record<string, ExampleObject | ReferenceObject>;
|
95 | example?: any;
|
96 | content?: ContentObject;
|
97 | }
|
98 | export interface ParameterObject extends BaseParameterObject {
|
99 | name: string;
|
100 | in: ParameterLocation;
|
101 | }
|
102 | export interface RequestBodyObject {
|
103 | description?: string;
|
104 | content: ContentObject;
|
105 | required?: boolean;
|
106 | }
|
107 | export type ContentObject = Record<string, MediaTypeObject>;
|
108 | export interface MediaTypeObject {
|
109 | schema?: SchemaObject | ReferenceObject;
|
110 | examples?: ExamplesObject;
|
111 | example?: any;
|
112 | encoding?: EncodingObject;
|
113 | }
|
114 | export type EncodingObject = Record<string, EncodingPropertyObject>;
|
115 | export interface EncodingPropertyObject {
|
116 | contentType?: string;
|
117 | headers?: Record<string, HeaderObject | ReferenceObject>;
|
118 | style?: string;
|
119 | explode?: boolean;
|
120 | allowReserved?: boolean;
|
121 | }
|
122 | export interface ResponsesObject extends Record<string, ResponseObject | ReferenceObject | undefined> {
|
123 | default?: ResponseObject | ReferenceObject;
|
124 | }
|
125 | export interface ResponseObject {
|
126 | description: string;
|
127 | headers?: HeadersObject;
|
128 | content?: ContentObject;
|
129 | links?: LinksObject;
|
130 | }
|
131 | export type CallbacksObject = Record<string, CallbackObject | ReferenceObject>;
|
132 | export type CallbackObject = Record<string, PathItemObject>;
|
133 | export type HeadersObject = Record<string, HeaderObject | ReferenceObject>;
|
134 | export interface ExampleObject {
|
135 | summary?: string;
|
136 | description?: string;
|
137 | value?: any;
|
138 | externalValue?: string;
|
139 | }
|
140 | export type LinksObject = Record<string, LinkObject | ReferenceObject>;
|
141 | export interface LinkObject {
|
142 | operationRef?: string;
|
143 | operationId?: string;
|
144 | parameters?: LinkParametersObject;
|
145 | requestBody?: any | string;
|
146 | description?: string;
|
147 | server?: ServerObject;
|
148 | }
|
149 | export type LinkParametersObject = Record<string, any>;
|
150 | export type HeaderObject = BaseParameterObject;
|
151 | export interface TagObject {
|
152 | name: string;
|
153 | description?: string;
|
154 | externalDocs?: ExternalDocumentationObject;
|
155 | }
|
156 | export type ExamplesObject = Record<string, ExampleObject | ReferenceObject>;
|
157 | export interface ReferenceObject {
|
158 | $ref: string;
|
159 | }
|
160 | export interface SchemaObject {
|
161 | nullable?: boolean;
|
162 | discriminator?: DiscriminatorObject;
|
163 | readOnly?: boolean;
|
164 | writeOnly?: boolean;
|
165 | xml?: XmlObject;
|
166 | externalDocs?: ExternalDocumentationObject;
|
167 | example?: any;
|
168 | examples?: any[] | Record<string, any>;
|
169 | deprecated?: boolean;
|
170 | type?: string;
|
171 | allOf?: (SchemaObject | ReferenceObject)[];
|
172 | oneOf?: (SchemaObject | ReferenceObject)[];
|
173 | anyOf?: (SchemaObject | ReferenceObject)[];
|
174 | not?: SchemaObject | ReferenceObject;
|
175 | items?: SchemaObject | ReferenceObject;
|
176 | properties?: Record<string, SchemaObject | ReferenceObject>;
|
177 | additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
178 | patternProperties?: SchemaObject | ReferenceObject | any;
|
179 | description?: string;
|
180 | format?: string;
|
181 | default?: any;
|
182 | title?: string;
|
183 | multipleOf?: number;
|
184 | maximum?: number;
|
185 | exclusiveMaximum?: boolean;
|
186 | minimum?: number;
|
187 | exclusiveMinimum?: boolean;
|
188 | maxLength?: number;
|
189 | minLength?: number;
|
190 | pattern?: string;
|
191 | maxItems?: number;
|
192 | minItems?: number;
|
193 | uniqueItems?: boolean;
|
194 | maxProperties?: number;
|
195 | minProperties?: number;
|
196 | required?: string[];
|
197 | enum?: any[];
|
198 | }
|
199 | export type SchemasObject = Record<string, SchemaObject>;
|
200 | export interface DiscriminatorObject {
|
201 | propertyName: string;
|
202 | mapping?: Record<string, string>;
|
203 | }
|
204 | export interface XmlObject {
|
205 | name?: string;
|
206 | namespace?: string;
|
207 | prefix?: string;
|
208 | attribute?: boolean;
|
209 | wrapped?: boolean;
|
210 | }
|
211 | export type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
|
212 | export interface SecuritySchemeObject {
|
213 | type: SecuritySchemeType;
|
214 | description?: string;
|
215 | name?: string;
|
216 | in?: string;
|
217 | scheme?: string;
|
218 | bearerFormat?: string;
|
219 | flows?: OAuthFlowsObject;
|
220 | openIdConnectUrl?: string;
|
221 | 'x-tokenName'?: string;
|
222 | }
|
223 | export interface OAuthFlowsObject {
|
224 | implicit?: OAuthFlowObject;
|
225 | password?: OAuthFlowObject;
|
226 | clientCredentials?: OAuthFlowObject;
|
227 | authorizationCode?: OAuthFlowObject;
|
228 | }
|
229 | export interface OAuthFlowObject {
|
230 | authorizationUrl?: string;
|
231 | tokenUrl?: string;
|
232 | refreshUrl?: string;
|
233 | scopes: ScopesObject;
|
234 | }
|
235 | export type ScopesObject = Record<string, any>;
|
236 | export type SecurityRequirementObject = Record<string, string[]>;
|