1 | import { ServerObject } from './oas-common';
|
2 | import { ISpecificationExtension } from './specification-extension';
|
3 | export * from './oas-common';
|
4 | export type { ISpecificationExtension, SpecificationExtension } from './specification-extension';
|
5 | export interface OpenAPIObject extends ISpecificationExtension {
|
6 | openapi: string;
|
7 | info: InfoObject;
|
8 | servers?: ServerObject[];
|
9 | paths?: PathsObject;
|
10 | components?: ComponentsObject;
|
11 | security?: SecurityRequirementObject[];
|
12 | tags?: TagObject[];
|
13 | externalDocs?: ExternalDocumentationObject;
|
14 | webhooks?: PathsObject;
|
15 | }
|
16 | export interface InfoObject extends ISpecificationExtension {
|
17 | title: string;
|
18 | description?: string;
|
19 | termsOfService?: string;
|
20 | contact?: ContactObject;
|
21 | license?: LicenseObject;
|
22 | version: string;
|
23 | }
|
24 | export interface ContactObject extends ISpecificationExtension {
|
25 | name?: string;
|
26 | url?: string;
|
27 | email?: string;
|
28 | }
|
29 | export interface LicenseObject extends ISpecificationExtension {
|
30 | name: string;
|
31 | identifier?: string;
|
32 | url?: string;
|
33 | }
|
34 | export interface ComponentsObject extends ISpecificationExtension {
|
35 | schemas?: {
|
36 | [schema: string]: SchemaObject | ReferenceObject;
|
37 | };
|
38 | responses?: {
|
39 | [response: string]: ResponseObject | ReferenceObject;
|
40 | };
|
41 | parameters?: {
|
42 | [parameter: string]: ParameterObject | ReferenceObject;
|
43 | };
|
44 | examples?: {
|
45 | [example: string]: ExampleObject | ReferenceObject;
|
46 | };
|
47 | requestBodies?: {
|
48 | [request: string]: RequestBodyObject | ReferenceObject;
|
49 | };
|
50 | headers?: {
|
51 | [header: string]: HeaderObject | ReferenceObject;
|
52 | };
|
53 | securitySchemes?: {
|
54 | [securityScheme: string]: SecuritySchemeObject | ReferenceObject;
|
55 | };
|
56 | links?: {
|
57 | [link: string]: LinkObject | ReferenceObject;
|
58 | };
|
59 | callbacks?: {
|
60 | [callback: string]: CallbackObject | ReferenceObject;
|
61 | };
|
62 | }
|
63 | export interface PathsObject extends ISpecificationExtension {
|
64 | [path: string]: PathItemObject;
|
65 | }
|
66 | export type PathObject = PathsObject;
|
67 | export declare function getPath(pathsObject: PathsObject | undefined, path: string): PathItemObject | undefined;
|
68 | export interface PathItemObject extends ISpecificationExtension {
|
69 | $ref?: string;
|
70 | summary?: string;
|
71 | description?: string;
|
72 | get?: OperationObject;
|
73 | put?: OperationObject;
|
74 | post?: OperationObject;
|
75 | delete?: OperationObject;
|
76 | options?: OperationObject;
|
77 | head?: OperationObject;
|
78 | patch?: OperationObject;
|
79 | trace?: OperationObject;
|
80 | servers?: ServerObject[];
|
81 | parameters?: (ParameterObject | ReferenceObject)[];
|
82 | }
|
83 | export interface OperationObject extends ISpecificationExtension {
|
84 | tags?: string[];
|
85 | summary?: string;
|
86 | description?: string;
|
87 | externalDocs?: ExternalDocumentationObject;
|
88 | operationId?: string;
|
89 | parameters?: (ParameterObject | ReferenceObject)[];
|
90 | requestBody?: RequestBodyObject | ReferenceObject;
|
91 | responses?: ResponsesObject;
|
92 | callbacks?: CallbacksObject;
|
93 | deprecated?: boolean;
|
94 | security?: SecurityRequirementObject[];
|
95 | servers?: ServerObject[];
|
96 | }
|
97 | export interface ExternalDocumentationObject extends ISpecificationExtension {
|
98 | description?: string;
|
99 | url: string;
|
100 | }
|
101 | export type ParameterLocation = 'query' | 'header' | 'path' | 'cookie';
|
102 | export type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
|
103 | export interface BaseParameterObject extends ISpecificationExtension {
|
104 | description?: string;
|
105 | required?: boolean;
|
106 | deprecated?: boolean;
|
107 | allowEmptyValue?: boolean;
|
108 | style?: ParameterStyle;
|
109 | explode?: boolean;
|
110 | allowReserved?: boolean;
|
111 | schema?: SchemaObject | ReferenceObject;
|
112 | examples?: {
|
113 | [param: string]: ExampleObject | ReferenceObject;
|
114 | };
|
115 | example?: any;
|
116 | content?: ContentObject;
|
117 | }
|
118 | export interface ParameterObject extends BaseParameterObject {
|
119 | name: string;
|
120 | in: ParameterLocation;
|
121 | }
|
122 | export interface RequestBodyObject extends ISpecificationExtension {
|
123 | description?: string;
|
124 | content: ContentObject;
|
125 | required?: boolean;
|
126 | }
|
127 | export interface ContentObject {
|
128 | [mediatype: string]: MediaTypeObject;
|
129 | }
|
130 | export interface MediaTypeObject extends ISpecificationExtension {
|
131 | schema?: SchemaObject | ReferenceObject;
|
132 | examples?: ExamplesObject;
|
133 | example?: any;
|
134 | encoding?: EncodingObject;
|
135 | }
|
136 | export interface EncodingObject extends ISpecificationExtension {
|
137 | [property: string]: EncodingPropertyObject | any;
|
138 | }
|
139 | export interface EncodingPropertyObject {
|
140 | contentType?: string;
|
141 | headers?: {
|
142 | [key: string]: HeaderObject | ReferenceObject;
|
143 | };
|
144 | style?: string;
|
145 | explode?: boolean;
|
146 | allowReserved?: boolean;
|
147 | [key: string]: any;
|
148 | }
|
149 | export interface ResponsesObject extends ISpecificationExtension {
|
150 | default?: ResponseObject | ReferenceObject;
|
151 | [statuscode: string]: ResponseObject | ReferenceObject | any;
|
152 | }
|
153 | export interface ResponseObject extends ISpecificationExtension {
|
154 | description: string;
|
155 | headers?: HeadersObject;
|
156 | content?: ContentObject;
|
157 | links?: LinksObject;
|
158 | }
|
159 | export interface CallbacksObject extends ISpecificationExtension {
|
160 | [name: string]: CallbackObject | ReferenceObject | any;
|
161 | }
|
162 | export interface CallbackObject extends ISpecificationExtension {
|
163 | [name: string]: PathItemObject | any;
|
164 | }
|
165 | export interface HeadersObject {
|
166 | [name: string]: HeaderObject | ReferenceObject;
|
167 | }
|
168 | export interface ExampleObject {
|
169 | summary?: string;
|
170 | description?: string;
|
171 | value?: any;
|
172 | externalValue?: string;
|
173 | [property: string]: any;
|
174 | }
|
175 | export interface LinksObject {
|
176 | [name: string]: LinkObject | ReferenceObject;
|
177 | }
|
178 | export interface LinkObject extends ISpecificationExtension {
|
179 | operationRef?: string;
|
180 | operationId?: string;
|
181 | parameters?: LinkParametersObject;
|
182 | requestBody?: any | string;
|
183 | description?: string;
|
184 | server?: ServerObject;
|
185 | [property: string]: any;
|
186 | }
|
187 | export interface LinkParametersObject {
|
188 | [name: string]: any | string;
|
189 | }
|
190 | export interface HeaderObject extends BaseParameterObject {
|
191 | $ref?: string;
|
192 | }
|
193 | export interface TagObject extends ISpecificationExtension {
|
194 | name: string;
|
195 | description?: string;
|
196 | externalDocs?: ExternalDocumentationObject;
|
197 | [extension: string]: any;
|
198 | }
|
199 | export interface ExamplesObject {
|
200 | [name: string]: ExampleObject | ReferenceObject;
|
201 | }
|
202 | export interface ReferenceObject {
|
203 | $ref: string;
|
204 | summary?: string;
|
205 | description?: string;
|
206 | }
|
207 | export declare function isReferenceObject(obj: any): obj is ReferenceObject;
|
208 | export type SchemaObjectType = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array';
|
209 | export interface SchemaObject extends ISpecificationExtension {
|
210 | discriminator?: DiscriminatorObject;
|
211 | readOnly?: boolean;
|
212 | writeOnly?: boolean;
|
213 | xml?: XmlObject;
|
214 | externalDocs?: ExternalDocumentationObject;
|
215 | example?: any;
|
216 | examples?: any[];
|
217 | deprecated?: boolean;
|
218 | type?: SchemaObjectType | SchemaObjectType[];
|
219 | format?: 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password' | string;
|
220 | allOf?: (SchemaObject | ReferenceObject)[];
|
221 | oneOf?: (SchemaObject | ReferenceObject)[];
|
222 | anyOf?: (SchemaObject | ReferenceObject)[];
|
223 | not?: SchemaObject | ReferenceObject;
|
224 | items?: SchemaObject | ReferenceObject;
|
225 | properties?: {
|
226 | [propertyName: string]: SchemaObject | ReferenceObject;
|
227 | };
|
228 | additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
229 | propertyNames?: SchemaObject | ReferenceObject;
|
230 | description?: string;
|
231 | default?: any;
|
232 | title?: string;
|
233 | multipleOf?: number;
|
234 | maximum?: number;
|
235 | const?: any;
|
236 | exclusiveMaximum?: number;
|
237 | minimum?: number;
|
238 | exclusiveMinimum?: number;
|
239 | maxLength?: number;
|
240 | minLength?: number;
|
241 | pattern?: string;
|
242 | maxItems?: number;
|
243 | minItems?: number;
|
244 | uniqueItems?: boolean;
|
245 | maxProperties?: number;
|
246 | minProperties?: number;
|
247 | required?: string[];
|
248 | enum?: any[];
|
249 | prefixItems?: (SchemaObject | ReferenceObject)[];
|
250 | contentMediaType?: string;
|
251 | contentEncoding?: string;
|
252 | }
|
253 | export declare function isSchemaObject(schema: SchemaObject | ReferenceObject): schema is SchemaObject;
|
254 | export interface SchemasObject {
|
255 | [schema: string]: SchemaObject;
|
256 | }
|
257 | export interface DiscriminatorObject {
|
258 | propertyName: string;
|
259 | mapping?: {
|
260 | [key: string]: string;
|
261 | };
|
262 | }
|
263 | export interface XmlObject extends ISpecificationExtension {
|
264 | name?: string;
|
265 | namespace?: string;
|
266 | prefix?: string;
|
267 | attribute?: boolean;
|
268 | wrapped?: boolean;
|
269 | }
|
270 | export type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
|
271 | export interface SecuritySchemeObject extends ISpecificationExtension {
|
272 | type: SecuritySchemeType;
|
273 | description?: string;
|
274 | name?: string;
|
275 | in?: string;
|
276 | scheme?: string;
|
277 | bearerFormat?: string;
|
278 | flows?: OAuthFlowsObject;
|
279 | openIdConnectUrl?: string;
|
280 | }
|
281 | export interface OAuthFlowsObject extends ISpecificationExtension {
|
282 | implicit?: OAuthFlowObject;
|
283 | password?: OAuthFlowObject;
|
284 | clientCredentials?: OAuthFlowObject;
|
285 | authorizationCode?: OAuthFlowObject;
|
286 | }
|
287 | export interface OAuthFlowObject extends ISpecificationExtension {
|
288 | authorizationUrl?: string;
|
289 | tokenUrl?: string;
|
290 | refreshUrl?: string;
|
291 | scopes: ScopesObject;
|
292 | }
|
293 | export interface ScopesObject extends ISpecificationExtension {
|
294 | [scope: string]: any;
|
295 | }
|
296 | export interface SecurityRequirementObject {
|
297 | [name: string]: string[];
|
298 | }
|