@scalar/openapi-types 0.4.0 → 0.5.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/openapi-types.d.ts +258 -98
  3. package/dist/openapi-types.d.ts.map +1 -1
  4. package/dist/openapi-types.js +0 -16
  5. package/dist/openapi-types.js.map +4 -4
  6. package/dist/openapi-types.test-d.js +28 -19
  7. package/dist/openapi-types.test-d.js.map +2 -2
  8. package/dist/schemas/3.1/processed/base-path-item-object.d.ts +4 -4
  9. package/dist/schemas/3.1/processed/callback-object.d.ts +6 -6
  10. package/dist/schemas/3.1/processed/components-object.d.ts +132 -132
  11. package/dist/schemas/3.1/processed/encoding-object.d.ts +1 -1
  12. package/dist/schemas/3.1/processed/header-object.d.ts +1 -1
  13. package/dist/schemas/3.1/processed/media-type-object.d.ts +1 -1
  14. package/dist/schemas/3.1/processed/openapi-object.d.ts +254 -254
  15. package/dist/schemas/3.1/processed/operation-object-without-callbacks.d.ts +8 -8
  16. package/dist/schemas/3.1/processed/parameter-object.d.ts +4 -4
  17. package/dist/schemas/3.1/processed/path-item-object.d.ts +116 -116
  18. package/dist/schemas/3.1/processed/paths-object.d.ts +116 -116
  19. package/dist/schemas/3.1/processed/request-body-object.d.ts +2 -2
  20. package/dist/schemas/3.1/processed/response-object.d.ts +2 -2
  21. package/dist/schemas/3.1/processed/responses-object.d.ts +2 -2
  22. package/dist/schemas/3.1/processed/security-scheme-object.d.ts +2 -2
  23. package/dist/schemas/3.1/processed/webhooks-object.d.ts +6 -6
  24. package/dist/schemas/3.1/unprocessed/base-path-item-object.d.ts +4 -4
  25. package/dist/schemas/3.1/unprocessed/callback-object.d.ts +6 -6
  26. package/dist/schemas/3.1/unprocessed/components-object.d.ts +132 -132
  27. package/dist/schemas/3.1/unprocessed/encoding-object.d.ts +1 -1
  28. package/dist/schemas/3.1/unprocessed/header-object.d.ts +1 -1
  29. package/dist/schemas/3.1/unprocessed/media-type-object.d.ts +1 -1
  30. package/dist/schemas/3.1/unprocessed/operation-object-without-callbacks.d.ts +8 -8
  31. package/dist/schemas/3.1/unprocessed/parameter-object.d.ts +4 -4
  32. package/dist/schemas/3.1/unprocessed/path-item-object.d.ts +116 -116
  33. package/dist/schemas/3.1/unprocessed/paths-object.d.ts +116 -116
  34. package/dist/schemas/3.1/unprocessed/request-body-object.d.ts +2 -2
  35. package/dist/schemas/3.1/unprocessed/response-object.d.ts +2 -2
  36. package/dist/schemas/3.1/unprocessed/responses-object.d.ts +2 -2
  37. package/dist/schemas/3.1/unprocessed/security-scheme-object.d.ts +2 -2
  38. package/dist/schemas/3.1/unprocessed/webhooks-object.d.ts +6 -6
  39. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @scalar/openapi-types
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f69e7cc: adds support for OpenAPI 3.2.0 definitions
8
+
9
+ ## 0.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 15c4240: feat: adds vesion 3.1.2 to the type definitions
14
+
3
15
  ## 0.4.0
4
16
 
5
17
  ### Minor Changes
@@ -14,25 +14,190 @@ type AnyOtherAttribute = {
14
14
  [key: string]: any;
15
15
  };
16
16
  export declare namespace OpenAPI {
17
- type Document<T extends AnyOtherAttribute = {}> = OpenAPIV2.Document<T> | OpenAPIV3.Document<T> | OpenAPIV3_1.Document<T>;
18
- type Operation<T = {}> = OpenAPIV2.OperationObject<T> | OpenAPIV3.OperationObject<T> | OpenAPIV3_1.OperationObject<T>;
17
+ type Document<T extends AnyOtherAttribute = {}> = OpenAPIV2.Document<T> | OpenAPIV3.Document<T> | OpenAPIV3_1.Document<T> | OpenAPIV3_2.Document<T>;
18
+ type Operation<T = {}> = OpenAPIV2.OperationObject<T> | OpenAPIV3.OperationObject<T> | OpenAPIV3_1.OperationObject<T> | OpenAPIV3_2.OperationObject<T>;
19
19
  type Request = {
20
20
  body?: any;
21
21
  headers?: object;
22
22
  params?: object;
23
23
  query?: object;
24
24
  };
25
- type ResponseObject = OpenAPIV2.ResponseObject | OpenAPIV3.ResponseObject | OpenAPIV3_1.ResponseObject;
26
- type HeaderObject = OpenAPIV2.HeaderObject | OpenAPIV3.HeaderObject | OpenAPIV3_1.HeaderObject;
27
- type Parameter = OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ParameterObject | OpenAPIV3.ReferenceObject | OpenAPIV3.ParameterObject | OpenAPIV2.ReferenceObject | OpenAPIV2.Parameter;
28
- type Parameters = (OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ParameterObject)[] | (OpenAPIV3.ReferenceObject | OpenAPIV3.ParameterObject)[] | (OpenAPIV2.ReferenceObject | OpenAPIV2.Parameter)[];
29
- type ExampleObject = OpenAPIV2.ExampleObject | OpenAPIV3.ExampleObject | OpenAPIV3_1.ExampleObject;
30
- type SchemaObject = OpenAPIV2.SchemaObject | OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject;
31
- type HttpMethod = keyof typeof OpenAPIV2.HttpMethods | OpenAPIV3.HttpMethods | OpenAPIV3_1.HttpMethods;
25
+ type ResponseObject = OpenAPIV2.ResponseObject | OpenAPIV3.ResponseObject | OpenAPIV3_1.ResponseObject | OpenAPIV3_2.ResponseObject;
26
+ type HeaderObject = OpenAPIV2.HeaderObject | OpenAPIV3.HeaderObject | OpenAPIV3_1.HeaderObject | OpenAPIV3_2.HeaderObject;
27
+ type Parameter = OpenAPIV3_2.ReferenceObject | OpenAPIV3_2.ParameterObject | OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ParameterObject | OpenAPIV3.ReferenceObject | OpenAPIV3.ParameterObject | OpenAPIV2.ReferenceObject | OpenAPIV2.Parameter;
28
+ type Parameters = (OpenAPIV3_2.ReferenceObject | OpenAPIV3_2.ParameterObject)[] | (OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ParameterObject)[] | (OpenAPIV3.ReferenceObject | OpenAPIV3.ParameterObject)[] | (OpenAPIV2.ReferenceObject | OpenAPIV2.Parameter)[];
29
+ type ExampleObject = OpenAPIV2.ExampleObject | OpenAPIV3.ExampleObject | OpenAPIV3_1.ExampleObject | OpenAPIV3_2.ExampleObject;
30
+ type SchemaObject = OpenAPIV2.SchemaObject | OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject | OpenAPIV3_2.SchemaObject;
31
+ type HttpMethod = OpenAPIV2.HttpMethods | OpenAPIV3.HttpMethods | OpenAPIV3_1.HttpMethods | OpenAPIV3_2.HttpMethods;
32
+ }
33
+ export declare namespace OpenAPIV3_2 {
34
+ type Modify<T, R> = Omit<T, keyof R> & R;
35
+ export type PathsWebhooksComponents<T = {}> = {
36
+ paths?: PathsObject<T>;
37
+ webhooks?: Record<string, PathItemObject | ReferenceObject>;
38
+ components?: ComponentsObject;
39
+ };
40
+ export type Document<T = {}> = Modify<Omit<OpenAPIV3_1.Document<T>, 'paths' | 'components' | 'webhooks' | 'tags'>, {
41
+ /**
42
+ * Version of the OpenAPI specification
43
+ * @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
44
+ */
45
+ openapi?: '3.2.0';
46
+ swagger?: never;
47
+ servers?: ServerObject[];
48
+ $self?: string;
49
+ tags?: TagObject[];
50
+ } & ((Pick<PathsWebhooksComponents<T>, 'paths'> & Omit<Partial<PathsWebhooksComponents<T>>, 'paths'>) | (Pick<PathsWebhooksComponents<T>, 'webhooks'> & Omit<Partial<PathsWebhooksComponents<T>>, 'webhooks'>) | (Pick<PathsWebhooksComponents<T>, 'components'> & Omit<Partial<PathsWebhooksComponents<T>>, 'components'>)) & T & AnyOtherAttribute>;
51
+ export type ServerObject = Modify<OpenAPIV3_1.ServerObject, {
52
+ name?: string;
53
+ }>;
54
+ export type PathsObject<T = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
55
+ export type HttpMethods = OpenAPIV3_1.HttpMethods | 'query';
56
+ export type PathItemObject<T = {}> = Modify<OpenAPIV3_1.PathItemObject<T>, {
57
+ [method in HttpMethods]?: OperationObject<T>;
58
+ }> & {
59
+ additionalOperations?: Record<string, OperationObject<T>>;
60
+ parameters?: (ReferenceObject | ParameterObject)[];
61
+ };
62
+ export type OperationObject<T = {}> = Modify<OpenAPIV3_1.OperationObject<T>, {
63
+ parameters?: (ReferenceObject | ParameterObject)[];
64
+ requestBody?: ReferenceObject | RequestBodyObject;
65
+ responses?: ResponsesObject;
66
+ callbacks?: Record<string, ReferenceObject | CallbackObject>;
67
+ servers?: ServerObject[];
68
+ }> & T;
69
+ export type ParameterStyle = OpenAPIV3_1.ParameterStyle | 'cookie';
70
+ export type ParameterLocation = OpenAPIV3_1.ParameterLocation | 'querystring';
71
+ export type ParameterObject = Modify<OpenAPIV3_1.ParameterObject, {
72
+ style?: ParameterStyle;
73
+ in?: ParameterLocation;
74
+ schema?: ReferenceObject | SchemaObject;
75
+ examples?: {
76
+ [media: string]: ReferenceObject | ExampleObject;
77
+ };
78
+ }>;
79
+ export type HeaderObject = Modify<OpenAPIV3_1.HeaderObject, {
80
+ content?: {
81
+ [media: string]: ReferenceObject | MediaTypeObject;
82
+ };
83
+ schema?: ReferenceObject | SchemaObject;
84
+ }>;
85
+ export type NonArraySchemaObjectType = OpenAPIV3_1.NonArraySchemaObjectType;
86
+ export type ArraySchemaObjectType = OpenAPIV3_1.ArraySchemaObjectType;
87
+ /**
88
+ * There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
89
+ * 'items' will be always visible as optional
90
+ * Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
91
+ */
92
+ export type SchemaObject = (ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject | boolean) & AnyOtherAttribute;
93
+ export type ArraySchemaObject = {
94
+ type?: ArraySchemaObjectType;
95
+ items?: ReferenceObject | SchemaObject;
96
+ } & BaseSchemaObject;
97
+ export type NonArraySchemaObject = {
98
+ type?: NonArraySchemaObjectType;
99
+ } & BaseSchemaObject;
100
+ type MixedSchemaObject = {
101
+ type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
102
+ items?: ReferenceObject | SchemaObject;
103
+ } & BaseSchemaObject;
104
+ export type BaseSchemaObject = Modify<OpenAPIV3_1.BaseSchemaObject, {
105
+ examples?: ExampleObject[];
106
+ discriminator?: DiscriminatorObject;
107
+ xml?: XMLObject;
108
+ }>;
109
+ export type DiscriminatorObject = OpenAPIV3_1.DiscriminatorObject & {
110
+ defaultMapping?: string;
111
+ };
112
+ export type XMLNodeType = 'element' | 'attribute' | 'text' | 'cdata' | 'comment';
113
+ export type XMLObject = Omit<OpenAPIV3_1.XMLObject, 'wrapped' | 'attribute'> & {
114
+ nodeType?: XMLNodeType;
115
+ };
116
+ export type ReferenceObject = OpenAPIV3_1.ReferenceObject;
117
+ export type ExampleObject = OpenAPIV3_1.ExampleObject & {
118
+ dataValue?: any;
119
+ serializedValue?: string;
120
+ };
121
+ export type MediaTypeObject = Modify<OpenAPIV3_1.MediaTypeObject, {
122
+ schema?: ReferenceObject | SchemaObject;
123
+ examples?: Record<string, ReferenceObject | ExampleObject>;
124
+ encoding?: {
125
+ [media: string]: EncodingObject;
126
+ };
127
+ }> & {
128
+ itemSchema?: ReferenceObject | SchemaObject;
129
+ itemEncoding?: EncodingObject;
130
+ prefixEncoding?: EncodingObject[];
131
+ };
132
+ export type EncodingObject = Modify<OpenAPIV3_1.EncodingObject, {
133
+ headers?: {
134
+ [header: string]: ReferenceObject | HeaderObject;
135
+ };
136
+ }> & {
137
+ encoding?: Record<string, EncodingObject>;
138
+ prefixEncoding?: EncodingObject[];
139
+ itemEncoding?: EncodingObject;
140
+ };
141
+ export type RequestBodyObject = Modify<OpenAPIV3_1.RequestBodyObject, {
142
+ content?: {
143
+ [media: string]: ReferenceObject | MediaTypeObject;
144
+ };
145
+ }>;
146
+ export type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
147
+ export type ResponseObject = Modify<OpenAPIV3_1.ResponseObject, {
148
+ headers?: {
149
+ [header: string]: ReferenceObject | HeaderObject;
150
+ };
151
+ content?: {
152
+ [media: string]: ReferenceObject | MediaTypeObject;
153
+ };
154
+ links?: {
155
+ [link: string]: ReferenceObject | LinkObject;
156
+ };
157
+ }> & {
158
+ summary?: string;
159
+ };
160
+ export type LinkObject = Modify<OpenAPIV3_1.LinkObject, {
161
+ server?: ServerObject;
162
+ }>;
163
+ export type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
164
+ export type ComponentsObject = Modify<OpenAPIV3_1.ComponentsObject, {
165
+ schemas?: Record<string, SchemaObject>;
166
+ responses?: Record<string, ReferenceObject | ResponseObject>;
167
+ parameters?: Record<string, ReferenceObject | ParameterObject>;
168
+ examples?: Record<string, ReferenceObject | ExampleObject>;
169
+ requestBodies?: Record<string, ReferenceObject | RequestBodyObject>;
170
+ headers?: Record<string, ReferenceObject | HeaderObject>;
171
+ securitySchemes?: Record<string, ReferenceObject | SecuritySchemeObject>;
172
+ links?: Record<string, ReferenceObject | LinkObject>;
173
+ callbacks?: Record<string, ReferenceObject | CallbackObject>;
174
+ pathItems?: Record<string, ReferenceObject | PathItemObject>;
175
+ mediaTypes?: Record<string, MediaTypeObject | ReferenceObject>;
176
+ }>;
177
+ export type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | (OpenIdSecurityScheme & {
178
+ deprecated?: boolean;
179
+ });
180
+ export type HttpSecurityScheme = OpenAPIV3_1.HttpSecurityScheme;
181
+ export type ApiKeySecurityScheme = OpenAPIV3_1.ApiKeySecurityScheme;
182
+ export type OAuthFlows = OpenAPIV3_1.OAuthFlows & {
183
+ deviceAuthorization?: AnyOtherAttribute & OpenAPIV3.OAuthFlowBase & OpenAPIV3.OAuthFlowTokenUrlTrait & {
184
+ deviceAuthorizationUrl?: string;
185
+ };
186
+ };
187
+ export type OAuth2SecurityScheme = Modify<OpenAPIV3_1.OAuth2SecurityScheme, {
188
+ flows?: OAuthFlows;
189
+ }>;
190
+ export type OpenIdSecurityScheme = OpenAPIV3_1.OpenIdSecurityScheme;
191
+ export type TagObject = OpenAPIV3_1.TagObject & {
192
+ summary?: string;
193
+ parent?: string;
194
+ kind?: string;
195
+ };
196
+ export {};
32
197
  }
33
198
  export declare namespace OpenAPIV3_1 {
34
199
  type Modify<T, R> = Omit<T, keyof R> & R;
35
- type PathsWebhooksComponents<T = {}> = {
200
+ export type PathsWebhooksComponents<T = {}> = {
36
201
  paths?: PathsObject<T>;
37
202
  webhooks?: Record<string, PathItemObject | ReferenceObject>;
38
203
  components?: ComponentsObject;
@@ -42,8 +207,8 @@ export declare namespace OpenAPIV3_1 {
42
207
  * Version of the OpenAPI specification
43
208
  * @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
44
209
  */
45
- openapi?: '3.1.0' | '3.1.1';
46
- swagger?: undefined;
210
+ openapi?: '3.1.0' | '3.1.1' | '3.1.2';
211
+ swagger?: never;
47
212
  info?: InfoObject;
48
213
  jsonSchemaDialect?: string;
49
214
  servers?: ServerObject[];
@@ -80,9 +245,19 @@ export declare namespace OpenAPIV3_1 {
80
245
  servers?: ServerObject[];
81
246
  }> & T;
82
247
  export type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
248
+ export type ParameterStyle = OpenAPIV3.ParameterStyle;
249
+ export type ParameterLocation = OpenAPIV3.ParameterLocation;
83
250
  export type ParameterObject = OpenAPIV3.ParameterObject;
84
- export type HeaderObject = OpenAPIV3.HeaderObject;
85
- export type ParameterBaseObject = OpenAPIV3.ParameterBaseObject;
251
+ export type HeaderObject = Modify<OpenAPIV3.HeaderObject, {
252
+ content?: {
253
+ [media: string]: MediaTypeObject;
254
+ };
255
+ }>;
256
+ export type ParameterBaseObject = Modify<OpenAPIV3.ParameterBaseObject, {
257
+ content?: {
258
+ [media: string]: MediaTypeObject;
259
+ };
260
+ }>;
86
261
  export type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | 'null';
87
262
  export type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
88
263
  /**
@@ -173,19 +348,20 @@ export declare namespace OpenAPIV3_1 {
173
348
  export type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
174
349
  export type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
175
350
  export type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
351
+ export type OAuthFlows = OpenAPIV3.OAuthFlows;
176
352
  export type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
177
353
  export type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
178
354
  export type TagObject = OpenAPIV3.TagObject;
179
355
  export {};
180
356
  }
181
357
  export declare namespace OpenAPIV3 {
182
- type Document<T = {}> = {
358
+ export type Document<T = {}> = {
183
359
  /**
184
360
  * Version of the OpenAPI specification
185
361
  * @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
186
362
  */
187
363
  openapi?: '3.0.0' | '3.0.1' | '3.0.2' | '3.0.3' | '3.0.4';
188
- swagger?: undefined;
364
+ swagger?: never;
189
365
  info?: InfoObject;
190
366
  servers?: ServerObject[];
191
367
  paths?: PathsObject<T>;
@@ -194,7 +370,7 @@ export declare namespace OpenAPIV3 {
194
370
  tags?: TagObject[];
195
371
  externalDocs?: ExternalDocumentationObject;
196
372
  } & T & AnyOtherAttribute;
197
- type InfoObject = {
373
+ export type InfoObject = {
198
374
  title?: string;
199
375
  description?: string;
200
376
  termsOfService?: string;
@@ -202,32 +378,32 @@ export declare namespace OpenAPIV3 {
202
378
  license?: LicenseObject;
203
379
  version?: string;
204
380
  };
205
- type ContactObject = {
381
+ export type ContactObject = {
206
382
  name?: string;
207
383
  url?: string;
208
384
  email?: string;
209
385
  };
210
- type LicenseObject = {
386
+ export type LicenseObject = {
211
387
  name?: string;
212
388
  url?: string;
213
389
  };
214
- type ServerObject = {
390
+ export type ServerObject = {
215
391
  url?: string;
216
392
  description?: string;
217
393
  variables?: {
218
394
  [variable: string]: ServerVariableObject;
219
395
  };
220
396
  };
221
- type ServerVariableObject = {
397
+ export type ServerVariableObject = {
222
398
  enum?: string[] | number[];
223
399
  default?: string | number;
224
400
  description?: string;
225
401
  };
226
- type PathsObject<T = {}, P extends {} = {}> = {
402
+ export type PathsObject<T = {}, P extends {} = {}> = {
227
403
  [pattern: string]: (PathItemObject<T> & P) | undefined;
228
404
  };
229
- type HttpMethods = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace' | 'connect';
230
- type PathItemObject<T = {}> = {
405
+ export type HttpMethods = OpenAPIV2.HttpMethods | 'trace';
406
+ export type PathItemObject<T = {}> = {
231
407
  $ref?: string;
232
408
  summary?: string;
233
409
  description?: string;
@@ -236,7 +412,7 @@ export declare namespace OpenAPIV3 {
236
412
  } & {
237
413
  [method in HttpMethods]?: OperationObject<T>;
238
414
  } & T & AnyOtherAttribute;
239
- type OperationObject<T = {}> = {
415
+ export type OperationObject<T = {}> = {
240
416
  tags?: string[];
241
417
  summary?: string;
242
418
  description?: string;
@@ -252,21 +428,23 @@ export declare namespace OpenAPIV3 {
252
428
  security?: SecurityRequirementObject[];
253
429
  servers?: ServerObject[];
254
430
  } & T & AnyOtherAttribute;
255
- type ExternalDocumentationObject = {
431
+ export type ExternalDocumentationObject = {
256
432
  description?: string;
257
433
  url?: string;
258
434
  };
259
- type ParameterObject = {
435
+ export type ParameterLocation = 'query' | 'header' | 'path' | 'cookie';
436
+ export type ParameterObject = {
260
437
  name?: string;
261
- in?: string;
438
+ in?: ParameterLocation;
262
439
  } & ParameterBaseObject;
263
- type HeaderObject = {} & ParameterBaseObject;
264
- type ParameterBaseObject = {
440
+ export type HeaderObject = {} & ParameterBaseObject;
441
+ export type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
442
+ export type ParameterBaseObject = {
265
443
  description?: string;
266
444
  required?: boolean;
267
445
  deprecated?: boolean;
268
446
  allowEmptyValue?: boolean;
269
- style?: string;
447
+ style?: ParameterStyle;
270
448
  explode?: boolean;
271
449
  allowReserved?: boolean;
272
450
  schema?: ReferenceObject | SchemaObject;
@@ -278,17 +456,17 @@ export declare namespace OpenAPIV3 {
278
456
  [media: string]: MediaTypeObject;
279
457
  };
280
458
  };
281
- type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
282
- type ArraySchemaObjectType = 'array';
283
- type SchemaObject = (ArraySchemaObject | NonArraySchemaObject) & AnyOtherAttribute;
284
- type ArraySchemaObject = {
459
+ export type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
460
+ export type ArraySchemaObjectType = 'array';
461
+ export type SchemaObject = (ArraySchemaObject | NonArraySchemaObject) & AnyOtherAttribute;
462
+ export type ArraySchemaObject = {
285
463
  type?: ArraySchemaObjectType;
286
464
  items?: ReferenceObject | SchemaObject;
287
465
  } & BaseSchemaObject;
288
- type NonArraySchemaObject = {
466
+ export type NonArraySchemaObject = {
289
467
  type?: NonArraySchemaObjectType;
290
468
  } & BaseSchemaObject;
291
- type BaseSchemaObject = {
469
+ export type BaseSchemaObject = {
292
470
  title?: string;
293
471
  description?: string;
294
472
  format?: string;
@@ -328,29 +506,29 @@ export declare namespace OpenAPIV3 {
328
506
  example?: any;
329
507
  deprecated?: boolean;
330
508
  };
331
- type DiscriminatorObject = {
509
+ export type DiscriminatorObject = {
332
510
  propertyName?: string;
333
511
  mapping?: {
334
512
  [value: string]: string;
335
513
  };
336
514
  };
337
- type XMLObject = {
515
+ export type XMLObject = {
338
516
  name?: string;
339
517
  namespace?: string;
340
518
  prefix?: string;
341
519
  attribute?: boolean;
342
520
  wrapped?: boolean;
343
521
  };
344
- type ReferenceObject = {
522
+ export type ReferenceObject = {
345
523
  $ref?: string;
346
524
  } & AnyOtherAttribute;
347
- type ExampleObject = {
525
+ export type ExampleObject = {
348
526
  summary?: string;
349
527
  description?: string;
350
528
  value?: any;
351
529
  externalValue?: string;
352
530
  };
353
- type MediaTypeObject = {
531
+ export type MediaTypeObject = {
354
532
  schema?: ReferenceObject | SchemaObject;
355
533
  example?: any;
356
534
  examples?: {
@@ -360,7 +538,7 @@ export declare namespace OpenAPIV3 {
360
538
  [media: string]: EncodingObject;
361
539
  };
362
540
  };
363
- type EncodingObject = {
541
+ export type EncodingObject = {
364
542
  contentType?: string;
365
543
  headers?: {
366
544
  [header: string]: ReferenceObject | HeaderObject;
@@ -369,17 +547,17 @@ export declare namespace OpenAPIV3 {
369
547
  explode?: boolean;
370
548
  allowReserved?: boolean;
371
549
  };
372
- type RequestBodyObject = {
550
+ export type RequestBodyObject = {
373
551
  description?: string;
374
552
  content?: {
375
553
  [media: string]: MediaTypeObject;
376
554
  };
377
555
  required?: boolean;
378
556
  };
379
- type ResponsesObject = {
557
+ export type ResponsesObject = {
380
558
  [code: string]: ReferenceObject | ResponseObject;
381
559
  };
382
- type ResponseObject = {
560
+ export type ResponseObject = {
383
561
  description?: string;
384
562
  headers?: {
385
563
  [header: string]: ReferenceObject | HeaderObject;
@@ -391,7 +569,7 @@ export declare namespace OpenAPIV3 {
391
569
  [link: string]: ReferenceObject | LinkObject;
392
570
  };
393
571
  } & AnyOtherAttribute;
394
- type LinkObject = {
572
+ export type LinkObject = {
395
573
  operationRef?: string;
396
574
  operationId?: string;
397
575
  parameters?: {
@@ -401,13 +579,13 @@ export declare namespace OpenAPIV3 {
401
579
  description?: string;
402
580
  server?: ServerObject;
403
581
  };
404
- type CallbackObject = {
582
+ export type CallbackObject = {
405
583
  [url: string]: PathItemObject;
406
584
  };
407
- type SecurityRequirementObject = {
585
+ export type SecurityRequirementObject = {
408
586
  [name: string]: string[];
409
587
  };
410
- type ComponentsObject = {
588
+ export type ComponentsObject = {
411
589
  schemas?: {
412
590
  [key: string]: ReferenceObject | SchemaObject;
413
591
  };
@@ -436,64 +614,53 @@ export declare namespace OpenAPIV3 {
436
614
  [key: string]: ReferenceObject | CallbackObject;
437
615
  };
438
616
  };
439
- type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
440
- type HttpSecurityScheme = {
617
+ export type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
618
+ export type HttpSecurityScheme = {
441
619
  type?: 'http';
442
620
  description?: string;
443
621
  scheme?: string;
444
622
  bearerFormat?: string;
445
623
  } & AnyOtherAttribute;
446
- type ApiKeySecurityScheme = {
624
+ export type ApiKeySecurityScheme = {
447
625
  type?: 'apiKey';
448
626
  description?: string;
449
627
  name?: string;
450
628
  in?: string;
451
629
  } & AnyOtherAttribute;
452
- type OAuth2SecurityScheme = {
630
+ export type OAuthFlowBase = {
631
+ scopes?: {
632
+ [scope: string]: string;
633
+ };
634
+ refreshUrl?: string;
635
+ };
636
+ type OAuthFlowAuthorizationUrlTrait = {
637
+ authorizationUrl?: string;
638
+ };
639
+ export type OAuthFlowTokenUrlTrait = {
640
+ tokenUrl?: string;
641
+ };
642
+ export type OAuthFlows = {
643
+ implicit?: AnyOtherAttribute & OAuthFlowBase & OAuthFlowAuthorizationUrlTrait;
644
+ password?: AnyOtherAttribute & OAuthFlowBase & OAuthFlowTokenUrlTrait;
645
+ clientCredentials?: AnyOtherAttribute & OAuthFlowBase & OAuthFlowTokenUrlTrait;
646
+ authorizationCode?: AnyOtherAttribute & OAuthFlowBase & OAuthFlowAuthorizationUrlTrait & OAuthFlowTokenUrlTrait;
647
+ };
648
+ export type OAuth2SecurityScheme = {
453
649
  type?: 'oauth2';
454
650
  description?: string;
455
- flows?: {
456
- implicit?: {
457
- authorizationUrl?: string;
458
- refreshUrl?: string;
459
- scopes?: {
460
- [scope: string]: string;
461
- };
462
- } & AnyOtherAttribute;
463
- password?: {
464
- tokenUrl?: string;
465
- refreshUrl?: string;
466
- scopes?: {
467
- [scope: string]: string;
468
- };
469
- } & AnyOtherAttribute;
470
- clientCredentials?: {
471
- tokenUrl?: string;
472
- refreshUrl?: string;
473
- scopes?: {
474
- [scope: string]: string;
475
- };
476
- } & AnyOtherAttribute;
477
- authorizationCode?: {
478
- authorizationUrl?: string;
479
- tokenUrl?: string;
480
- refreshUrl?: string;
481
- scopes?: {
482
- [scope: string]: string;
483
- };
484
- } & AnyOtherAttribute;
485
- };
486
- };
487
- type OpenIdSecurityScheme = {
651
+ flows?: OAuthFlows;
652
+ };
653
+ export type OpenIdSecurityScheme = {
488
654
  type?: 'openIdConnect';
489
655
  description?: string;
490
656
  openIdConnectUrl?: string;
491
657
  } & AnyOtherAttribute;
492
- type TagObject = {
658
+ export type TagObject = {
493
659
  name?: string;
494
660
  description?: string;
495
661
  externalDocs?: ExternalDocumentationObject;
496
662
  } & AnyOtherAttribute;
663
+ export {};
497
664
  }
498
665
  export declare namespace OpenAPIV2 {
499
666
  type Document<T = {}> = {
@@ -617,15 +784,7 @@ export declare namespace OpenAPIV2 {
617
784
  type GeneralParameterObject = {
618
785
  allowEmptyValue?: boolean;
619
786
  } & ParameterObject & ItemsObject;
620
- enum HttpMethods {
621
- GET = "get",
622
- PUT = "put",
623
- POST = "post",
624
- DELETE = "delete",
625
- OPTIONS = "options",
626
- HEAD = "head",
627
- PATCH = "patch"
628
- }
787
+ type HttpMethods = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch';
629
788
  type PathItemObject<T = {}> = {
630
789
  $ref?: string;
631
790
  parameters?: Parameters;
@@ -638,9 +797,10 @@ export declare namespace OpenAPIV2 {
638
797
  type ParametersDefinitionsObject = {
639
798
  [index: string]: ParameterObject;
640
799
  };
800
+ type ParameterLocation = 'query' | 'header' | 'path' | 'formData' | 'body';
641
801
  type ParameterObject = {
642
802
  name?: string;
643
- in?: string;
803
+ in?: ParameterLocation;
644
804
  description?: string;
645
805
  required?: boolean;
646
806
  [index: string]: any;