openapi-schema-type 1.0.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.
- package/README.md +246 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +32 -0
- package/typings/openapi_spec_3.1_schema.d.ts +1048 -0
- package/typings/openapi_spec_3.2_schema.d.ts +1112 -0
|
@@ -0,0 +1,1112 @@
|
|
|
1
|
+
import type { JSONSchemaMeta202012 } from "json-schema-meta-type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OpenAPI 3.2 Specification TypeScript Type Definitions
|
|
5
|
+
* Generated from openapi_spec_3.2_schema_2025-09-17.json
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// ===============
|
|
9
|
+
// MARK: Base Types
|
|
10
|
+
// ===============
|
|
11
|
+
export type SpecificationExtensionKey = `x-${string}`;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Extension fields for OpenAPI specification
|
|
15
|
+
* Allows adding custom properties with names starting with "x-"
|
|
16
|
+
* $comment: https://spec.openapis.org/oas/v3.2#specification-extensions
|
|
17
|
+
*/
|
|
18
|
+
export type SpecificationExtensions = Record<
|
|
19
|
+
SpecificationExtensionKey,
|
|
20
|
+
unknown
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A simple object to allow referencing other components in the specification
|
|
25
|
+
* $comment: https://spec.openapis.org/oas/v3.2#reference-object
|
|
26
|
+
*/
|
|
27
|
+
export interface ReferenceObject {
|
|
28
|
+
/**
|
|
29
|
+
* The reference string
|
|
30
|
+
*/
|
|
31
|
+
$ref: string;
|
|
32
|
+
/**
|
|
33
|
+
* A short summary which by default should override that of the referenced component
|
|
34
|
+
*/
|
|
35
|
+
summary?: string;
|
|
36
|
+
/**
|
|
37
|
+
* A description which by default should override that of the referenced component
|
|
38
|
+
*/
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The Schema Object allows the definition of input and output data types
|
|
44
|
+
*/
|
|
45
|
+
export type SchemaObject = Exclude<JSONSchemaMeta202012, boolean>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A simple map of string to string
|
|
49
|
+
*/
|
|
50
|
+
export type MapOfString = Record<string, string>;
|
|
51
|
+
|
|
52
|
+
// ===============
|
|
53
|
+
// MARK: Info Objects
|
|
54
|
+
// ===============
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The object provides metadata about the API
|
|
58
|
+
* $comment: https://spec.openapis.org/oas/v3.2#info-object
|
|
59
|
+
*/
|
|
60
|
+
export type InfoObject = {
|
|
61
|
+
/**
|
|
62
|
+
* The title of the API
|
|
63
|
+
*/
|
|
64
|
+
title: string;
|
|
65
|
+
/**
|
|
66
|
+
* A short summary of the API
|
|
67
|
+
*/
|
|
68
|
+
summary?: string;
|
|
69
|
+
/**
|
|
70
|
+
* A verbose description of the API
|
|
71
|
+
* CommonMark syntax can be used for rich text representation
|
|
72
|
+
*/
|
|
73
|
+
description?: string;
|
|
74
|
+
/**
|
|
75
|
+
* A URL to the Terms of Service for the API
|
|
76
|
+
* MUST be in URL format
|
|
77
|
+
*/
|
|
78
|
+
termsOfService?: string;
|
|
79
|
+
/**
|
|
80
|
+
* The contact information for the exposed API
|
|
81
|
+
*/
|
|
82
|
+
contact?: ContactObject;
|
|
83
|
+
/**
|
|
84
|
+
* The license information for the exposed API
|
|
85
|
+
*/
|
|
86
|
+
license?: LicenseObject;
|
|
87
|
+
/**
|
|
88
|
+
* The version of the OpenAPI document
|
|
89
|
+
*/
|
|
90
|
+
version: string;
|
|
91
|
+
} & SpecificationExtensions;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Contact information for the exposed API
|
|
95
|
+
* $comment: https://spec.openapis.org/oas/v3.2#contact-object
|
|
96
|
+
*/
|
|
97
|
+
export type ContactObject = {
|
|
98
|
+
/**
|
|
99
|
+
* The identifying name of the contact person/organization
|
|
100
|
+
*/
|
|
101
|
+
name?: string;
|
|
102
|
+
/**
|
|
103
|
+
* The URL pointing to the contact information
|
|
104
|
+
* MUST be in URL format
|
|
105
|
+
*/
|
|
106
|
+
url?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The email address of the contact person/organization
|
|
109
|
+
* MUST be in email format
|
|
110
|
+
*/
|
|
111
|
+
email?: string;
|
|
112
|
+
} & SpecificationExtensions;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* License information for the exposed API
|
|
116
|
+
* $comment: https://spec.openapis.org/oas/v3.2#license-object
|
|
117
|
+
*/
|
|
118
|
+
export type LicenseObject = {
|
|
119
|
+
/**
|
|
120
|
+
* The license name used for the API
|
|
121
|
+
*/
|
|
122
|
+
name: string;
|
|
123
|
+
/**
|
|
124
|
+
* An SPDX license expression for the API
|
|
125
|
+
*/
|
|
126
|
+
identifier?: string;
|
|
127
|
+
/**
|
|
128
|
+
* A URL to the license used for the API
|
|
129
|
+
* MUST be in URL format
|
|
130
|
+
*/
|
|
131
|
+
url?: string;
|
|
132
|
+
} & SpecificationExtensions;
|
|
133
|
+
|
|
134
|
+
// ===============
|
|
135
|
+
// MARK: Server Objects
|
|
136
|
+
// ===============
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* An object representing a Server
|
|
140
|
+
* $comment: https://spec.openapis.org/oas/v3.2#server-object
|
|
141
|
+
*/
|
|
142
|
+
export type ServerObject = {
|
|
143
|
+
/**
|
|
144
|
+
* A URL to the target host
|
|
145
|
+
* May be a relative path
|
|
146
|
+
*/
|
|
147
|
+
url: string;
|
|
148
|
+
/**
|
|
149
|
+
* An optional string describing the host designated by the URL
|
|
150
|
+
*/
|
|
151
|
+
description?: string;
|
|
152
|
+
/**
|
|
153
|
+
* An optional name for the server
|
|
154
|
+
*/
|
|
155
|
+
name?: string;
|
|
156
|
+
/**
|
|
157
|
+
* A map between a variable name and its value
|
|
158
|
+
*/
|
|
159
|
+
variables?: Record<string, ServerVariableObject>;
|
|
160
|
+
} & SpecificationExtensions;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* An object representing a Server Variable for server URL template substitution
|
|
164
|
+
* $comment: https://spec.openapis.org/oas/v3.2#server-variable-object
|
|
165
|
+
*/
|
|
166
|
+
export type ServerVariableObject = {
|
|
167
|
+
/**
|
|
168
|
+
* An enumeration of string values to be used if the substitution options are from a limited set
|
|
169
|
+
*/
|
|
170
|
+
enum?: string[];
|
|
171
|
+
/**
|
|
172
|
+
* The default value to use for substitution
|
|
173
|
+
*/
|
|
174
|
+
default: string;
|
|
175
|
+
/**
|
|
176
|
+
* An optional description for the server variable
|
|
177
|
+
*/
|
|
178
|
+
description?: string;
|
|
179
|
+
} & SpecificationExtensions;
|
|
180
|
+
|
|
181
|
+
// ===============
|
|
182
|
+
// MARK: Components Object
|
|
183
|
+
// ===============
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Holds a set of reusable objects for different aspects of the OAS
|
|
187
|
+
* $comment: https://spec.openapis.org/oas/v3.2#components-object
|
|
188
|
+
*/
|
|
189
|
+
export type ComponentsObject = {
|
|
190
|
+
/**
|
|
191
|
+
* An object to hold reusable Schema Objects
|
|
192
|
+
*/
|
|
193
|
+
schemas?: Record<string, SchemaObject>;
|
|
194
|
+
/**
|
|
195
|
+
* An object to hold reusable Response Objects
|
|
196
|
+
*/
|
|
197
|
+
responses?: Record<string, ResponseOrReferenceObject>;
|
|
198
|
+
/**
|
|
199
|
+
* An object to hold reusable Parameter Objects
|
|
200
|
+
*/
|
|
201
|
+
parameters?: Record<string, ParameterOrReferenceObject>;
|
|
202
|
+
/**
|
|
203
|
+
* An object to hold reusable Example Objects
|
|
204
|
+
*/
|
|
205
|
+
examples?: Record<string, ExampleOrReferenceObject>;
|
|
206
|
+
/**
|
|
207
|
+
* An object to hold reusable Request Body Objects
|
|
208
|
+
*/
|
|
209
|
+
requestBodies?: Record<string, RequestBodyOrReferenceObject>;
|
|
210
|
+
/**
|
|
211
|
+
* An object to hold reusable Header Objects
|
|
212
|
+
*/
|
|
213
|
+
headers?: Record<string, HeaderOrReferenceObject>;
|
|
214
|
+
/**
|
|
215
|
+
* An object to hold reusable Security Scheme Objects
|
|
216
|
+
*/
|
|
217
|
+
securitySchemes?: Record<string, SecuritySchemeOrReferenceObject>;
|
|
218
|
+
/**
|
|
219
|
+
* An object to hold reusable Link Objects
|
|
220
|
+
*/
|
|
221
|
+
links?: Record<string, LinkOrReferenceObject>;
|
|
222
|
+
/**
|
|
223
|
+
* An object to hold reusable Callback Objects
|
|
224
|
+
*/
|
|
225
|
+
callbacks?: Record<string, CallbacksOrReferenceObject>;
|
|
226
|
+
/**
|
|
227
|
+
* An object to hold reusable path item objects
|
|
228
|
+
*/
|
|
229
|
+
pathItems?: Record<string, PathItemObject>;
|
|
230
|
+
/**
|
|
231
|
+
* An object to hold reusable media type objects
|
|
232
|
+
*/
|
|
233
|
+
mediaTypes?: Record<string, MediaTypeOrReferenceObject>;
|
|
234
|
+
} & SpecificationExtensions;
|
|
235
|
+
|
|
236
|
+
// ===============
|
|
237
|
+
// MARK: Paths and Operations
|
|
238
|
+
// ===============
|
|
239
|
+
|
|
240
|
+
export type PathKey = `/${string}`;
|
|
241
|
+
/**
|
|
242
|
+
* Holds the relative paths to the individual endpoints and their operations
|
|
243
|
+
* $comment: https://spec.openapis.org/oas/v3.2#paths-object
|
|
244
|
+
*/
|
|
245
|
+
export type PathsObject = Record<PathKey, PathItemObject> &
|
|
246
|
+
SpecificationExtensions;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Describes the operations available on a single path
|
|
250
|
+
* $comment: https://spec.openapis.org/oas/v3.2#path-item-object
|
|
251
|
+
*/
|
|
252
|
+
export type PathItemObject = {
|
|
253
|
+
/**
|
|
254
|
+
* A reference to a path item object
|
|
255
|
+
*/
|
|
256
|
+
$ref?: string;
|
|
257
|
+
/**
|
|
258
|
+
* An optional, string summary
|
|
259
|
+
*/
|
|
260
|
+
summary?: string;
|
|
261
|
+
/**
|
|
262
|
+
* An optional, string description
|
|
263
|
+
*/
|
|
264
|
+
description?: string;
|
|
265
|
+
/**
|
|
266
|
+
* An alternative server array to service all operations in this path
|
|
267
|
+
*/
|
|
268
|
+
servers?: ServerObject[];
|
|
269
|
+
/**
|
|
270
|
+
* A list of parameters that are applicable for all the operations described under this path
|
|
271
|
+
*/
|
|
272
|
+
parameters?: ParameterObject[];
|
|
273
|
+
/**
|
|
274
|
+
* A map of operations that are not part of the standard HTTP methods
|
|
275
|
+
*/
|
|
276
|
+
additionalOperations?: Record<string, OperationObject>;
|
|
277
|
+
/**
|
|
278
|
+
* A definition of a GET operation on this path
|
|
279
|
+
*/
|
|
280
|
+
get?: OperationObject;
|
|
281
|
+
/**
|
|
282
|
+
* A definition of a PUT operation on this path
|
|
283
|
+
*/
|
|
284
|
+
put?: OperationObject;
|
|
285
|
+
/**
|
|
286
|
+
* A definition of a POST operation on this path
|
|
287
|
+
*/
|
|
288
|
+
post?: OperationObject;
|
|
289
|
+
/**
|
|
290
|
+
* A definition of a DELETE operation on this path
|
|
291
|
+
*/
|
|
292
|
+
delete?: OperationObject;
|
|
293
|
+
/**
|
|
294
|
+
* A definition of an OPTIONS operation on this path
|
|
295
|
+
*/
|
|
296
|
+
options?: OperationObject;
|
|
297
|
+
/**
|
|
298
|
+
* A definition of a HEAD operation on this path
|
|
299
|
+
*/
|
|
300
|
+
head?: OperationObject;
|
|
301
|
+
/**
|
|
302
|
+
* A definition of a PATCH operation on this path
|
|
303
|
+
*/
|
|
304
|
+
patch?: OperationObject;
|
|
305
|
+
/**
|
|
306
|
+
* A definition of a TRACE operation on this path
|
|
307
|
+
*/
|
|
308
|
+
trace?: OperationObject;
|
|
309
|
+
/**
|
|
310
|
+
* A definition of a QUERY operation on this path
|
|
311
|
+
*/
|
|
312
|
+
query?: OperationObject;
|
|
313
|
+
} & SpecificationExtensions;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Describes a single API operation on a path
|
|
317
|
+
* $comment: https://spec.openapis.org/oas/v3.2#operation-object
|
|
318
|
+
*/
|
|
319
|
+
export type OperationObject = {
|
|
320
|
+
/**
|
|
321
|
+
* A list of tags for API documentation control
|
|
322
|
+
*/
|
|
323
|
+
tags?: string[];
|
|
324
|
+
/**
|
|
325
|
+
* A short summary of what the operation does
|
|
326
|
+
*/
|
|
327
|
+
summary?: string;
|
|
328
|
+
/**
|
|
329
|
+
* A verbose explanation of the operation behavior
|
|
330
|
+
*/
|
|
331
|
+
description?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Additional external documentation for this operation
|
|
334
|
+
*/
|
|
335
|
+
externalDocs?: ExternalDocumentationObject;
|
|
336
|
+
/**
|
|
337
|
+
* Unique string used to identify the operation
|
|
338
|
+
*/
|
|
339
|
+
operationId?: string;
|
|
340
|
+
/**
|
|
341
|
+
* A list of parameters that are applicable for this operation
|
|
342
|
+
*/
|
|
343
|
+
parameters?: ParameterObject[];
|
|
344
|
+
/**
|
|
345
|
+
* The request body applicable for this operation
|
|
346
|
+
*/
|
|
347
|
+
requestBody?: RequestBodyOrReferenceObject;
|
|
348
|
+
/**
|
|
349
|
+
* The list of possible responses as they are returned from executing this operation
|
|
350
|
+
*/
|
|
351
|
+
responses?: ResponsesObject;
|
|
352
|
+
/**
|
|
353
|
+
* A map of possible out-of-band callbacks related to the parent operation
|
|
354
|
+
*/
|
|
355
|
+
callbacks?: Record<string, CallbacksOrReferenceObject>;
|
|
356
|
+
/**
|
|
357
|
+
* Declares this operation to be deprecated
|
|
358
|
+
*/
|
|
359
|
+
deprecated?: boolean;
|
|
360
|
+
/**
|
|
361
|
+
* A declaration of which security schemes can be used for this operation
|
|
362
|
+
*/
|
|
363
|
+
security?: SecurityRequirementObject[];
|
|
364
|
+
/**
|
|
365
|
+
* An alternative server array to service this operation
|
|
366
|
+
*/
|
|
367
|
+
servers?: ServerObject[];
|
|
368
|
+
} & SpecificationExtensions;
|
|
369
|
+
|
|
370
|
+
// ===============
|
|
371
|
+
// MARK: Parameters
|
|
372
|
+
// ===============
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* The location of the parameter
|
|
376
|
+
*/
|
|
377
|
+
export type ParameterLocation =
|
|
378
|
+
| "query"
|
|
379
|
+
| "querystring"
|
|
380
|
+
| "header"
|
|
381
|
+
| "path"
|
|
382
|
+
| "cookie";
|
|
383
|
+
|
|
384
|
+
type ParameterProperties = {
|
|
385
|
+
/**
|
|
386
|
+
* The name of the parameter
|
|
387
|
+
*/
|
|
388
|
+
name: string;
|
|
389
|
+
/**
|
|
390
|
+
* A brief description of the parameter
|
|
391
|
+
*/
|
|
392
|
+
description?: string;
|
|
393
|
+
/**
|
|
394
|
+
* Determines whether this parameter is mandatory
|
|
395
|
+
*/
|
|
396
|
+
required?: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Specifies that a parameter is deprecated
|
|
399
|
+
*/
|
|
400
|
+
deprecated?: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* Example of the parameter's potential value
|
|
403
|
+
*/
|
|
404
|
+
example?: unknown;
|
|
405
|
+
/**
|
|
406
|
+
* Examples of the parameter's potential value
|
|
407
|
+
*/
|
|
408
|
+
examples?: Record<string, ExampleOrReferenceObject>;
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
type ParameterPropertiesForSchema = Exclude<ParameterProperties, "in"> & {
|
|
412
|
+
schema: SchemaObject;
|
|
413
|
+
/**
|
|
414
|
+
* When this is true, parameter values of type array or object generate separate parameters
|
|
415
|
+
*/
|
|
416
|
+
explode?: boolean;
|
|
417
|
+
/**
|
|
418
|
+
* Determines whether the parameter value should be percent-encoded
|
|
419
|
+
* @default false
|
|
420
|
+
*/
|
|
421
|
+
allowReserved?: boolean;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
type ParameterStyleForPath = ParameterPropertiesForSchema & {
|
|
425
|
+
in: "path";
|
|
426
|
+
/**
|
|
427
|
+
* Describes how the parameter value will be serialized
|
|
428
|
+
* @default simple
|
|
429
|
+
*/
|
|
430
|
+
style?: "simple" | "matrix" | "label";
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
type ParameterStyleForHeader = ParameterPropertiesForSchema & {
|
|
434
|
+
in: "header";
|
|
435
|
+
/**
|
|
436
|
+
* Describes how the parameter value will be serialized
|
|
437
|
+
* @default simple
|
|
438
|
+
*/
|
|
439
|
+
style?: "simple";
|
|
440
|
+
};
|
|
441
|
+
type ParameterStyleForQuery = ParameterPropertiesForSchema & {
|
|
442
|
+
in: "query";
|
|
443
|
+
/**
|
|
444
|
+
* Describes how the parameter value will be serialized
|
|
445
|
+
* @default form
|
|
446
|
+
*/
|
|
447
|
+
style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject";
|
|
448
|
+
/**
|
|
449
|
+
* Specifies whether the parameter allows empty values
|
|
450
|
+
* Only applicable for query parameters
|
|
451
|
+
* @default false
|
|
452
|
+
*/
|
|
453
|
+
allowEmptyValue?: boolean;
|
|
454
|
+
};
|
|
455
|
+
type ParameterStyleForCookie = ParameterPropertiesForSchema & {
|
|
456
|
+
in: "cookie";
|
|
457
|
+
/**
|
|
458
|
+
* Describes how the parameter value will be serialized
|
|
459
|
+
* @default form
|
|
460
|
+
*/
|
|
461
|
+
style?: "form" | "cookie";
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
export type ParameterObjectWithSchema = ParameterStyleForPath | ParameterStyleForQuery | ParameterStyleForHeader | ParameterStyleForCookie;
|
|
465
|
+
export type ParameterObjectWithContent = ParameterProperties & {
|
|
466
|
+
in?: "querystring";
|
|
467
|
+
/**
|
|
468
|
+
* A map containing the representations for the parameter
|
|
469
|
+
*/
|
|
470
|
+
content: ContentObject;
|
|
471
|
+
};
|
|
472
|
+
/**
|
|
473
|
+
* Describes a single operation parameter
|
|
474
|
+
* $comment: https://spec.openapis.org/oas/v3.2#parameter-object
|
|
475
|
+
*/
|
|
476
|
+
export type ParameterObject = (ParameterObjectWithSchema | ParameterObjectWithContent) & SpecificationExtensions;
|
|
477
|
+
|
|
478
|
+
// ===============
|
|
479
|
+
// MARK: Request/Response Bodies
|
|
480
|
+
// ===============
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Describes a single request body
|
|
484
|
+
* $comment: https://spec.openapis.org/oas/v3.2#request-body-object
|
|
485
|
+
*/
|
|
486
|
+
export type RequestBodyObject = {
|
|
487
|
+
/**
|
|
488
|
+
* A brief description of the request body
|
|
489
|
+
*/
|
|
490
|
+
description?: string;
|
|
491
|
+
/**
|
|
492
|
+
* The content of the request body
|
|
493
|
+
*/
|
|
494
|
+
content: ContentObject;
|
|
495
|
+
/**
|
|
496
|
+
* Determines if the request body is required in the request
|
|
497
|
+
*/
|
|
498
|
+
required?: boolean;
|
|
499
|
+
} & SpecificationExtensions;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* A container for the expected responses of an operation
|
|
503
|
+
* either default, or at least one response code property must exist
|
|
504
|
+
* $comment: https://spec.openapis.org/oas/v3.2#responses-object
|
|
505
|
+
*/
|
|
506
|
+
export type ResponsesObject = {
|
|
507
|
+
/**
|
|
508
|
+
* The documentation of responses other than the ones declared for specific HTTP response codes
|
|
509
|
+
*/
|
|
510
|
+
default?: ResponseOrReferenceObject;
|
|
511
|
+
/**
|
|
512
|
+
* Any HTTP status code can be used as a property name
|
|
513
|
+
* statusCode pattern ^[1-5](?:[0-9]{2}|XX)$
|
|
514
|
+
*/
|
|
515
|
+
[statusCode: `${number}` | `${number}XX`]: ResponseOrReferenceObject;
|
|
516
|
+
} & SpecificationExtensions;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Describes a single response from an API Operation
|
|
520
|
+
* $comment: https://spec.openapis.org/oas/v3.2#response-object
|
|
521
|
+
*/
|
|
522
|
+
export type ResponseObject = {
|
|
523
|
+
/**
|
|
524
|
+
* A short summary of the response
|
|
525
|
+
*/
|
|
526
|
+
summary?: string;
|
|
527
|
+
/**
|
|
528
|
+
* A description of the response
|
|
529
|
+
*/
|
|
530
|
+
description?: string;
|
|
531
|
+
/**
|
|
532
|
+
* Maps a header name to its definition
|
|
533
|
+
*/
|
|
534
|
+
headers?: Record<string, HeaderOrReferenceObject>;
|
|
535
|
+
/**
|
|
536
|
+
* A map containing descriptions of potential response payloads
|
|
537
|
+
*/
|
|
538
|
+
content?: ContentObject;
|
|
539
|
+
/**
|
|
540
|
+
* A map of operations links that can be followed from the response
|
|
541
|
+
*/
|
|
542
|
+
links?: Record<string, LinkOrReferenceObject>;
|
|
543
|
+
} & SpecificationExtensions;
|
|
544
|
+
|
|
545
|
+
// ===============
|
|
546
|
+
// MARK: Content and Media Types
|
|
547
|
+
// ===============
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* A map containing descriptions of potential response payloads
|
|
551
|
+
* $comment: https://spec.openapis.org/oas/v3.2#fixed-fields-10
|
|
552
|
+
*/
|
|
553
|
+
export interface ContentObject {
|
|
554
|
+
/**
|
|
555
|
+
* The media type of the content
|
|
556
|
+
*/
|
|
557
|
+
[mediaType: string]: MediaTypeOrReferenceObject;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Provides schema and examples for the media type
|
|
562
|
+
* $comment: https://spec.openapis.org/oas/v3.2#media-type-object
|
|
563
|
+
*/
|
|
564
|
+
export type MediaTypeObject = {
|
|
565
|
+
/**
|
|
566
|
+
* A description of the media type
|
|
567
|
+
*/
|
|
568
|
+
description?: string;
|
|
569
|
+
/**
|
|
570
|
+
* The schema defining the type used for the request body
|
|
571
|
+
*/
|
|
572
|
+
schema?: SchemaObject;
|
|
573
|
+
/**
|
|
574
|
+
* The schema defining the type used for array items
|
|
575
|
+
*/
|
|
576
|
+
itemSchema?: SchemaObject;
|
|
577
|
+
/**
|
|
578
|
+
* A map between a property name and its encoding information
|
|
579
|
+
*/
|
|
580
|
+
encoding?: Record<string, EncodingObject>;
|
|
581
|
+
/**
|
|
582
|
+
* Encoding information for array prefixes
|
|
583
|
+
*/
|
|
584
|
+
prefixEncoding?: EncodingObject[];
|
|
585
|
+
/**
|
|
586
|
+
* Encoding information for array items
|
|
587
|
+
*/
|
|
588
|
+
itemEncoding?: EncodingObject;
|
|
589
|
+
/**
|
|
590
|
+
* Example of the media type
|
|
591
|
+
*/
|
|
592
|
+
example?: unknown;
|
|
593
|
+
/**
|
|
594
|
+
* Examples of the media type
|
|
595
|
+
*/
|
|
596
|
+
examples?: Record<string, ExampleOrReferenceObject>;
|
|
597
|
+
} & SpecificationExtensions;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* A single encoding definition applied to a single schema property
|
|
601
|
+
* $comment: https://spec.openapis.org/oas/v3.2#encoding-object
|
|
602
|
+
*/
|
|
603
|
+
export type EncodingObject = {
|
|
604
|
+
/**
|
|
605
|
+
* The Content-Type for encoding a specific property
|
|
606
|
+
*/
|
|
607
|
+
contentType?: string;
|
|
608
|
+
/**
|
|
609
|
+
* A map allowing additional information to be provided as headers
|
|
610
|
+
*/
|
|
611
|
+
headers?: Record<string, HeaderOrReferenceObject>;
|
|
612
|
+
/**
|
|
613
|
+
* The style of the encoding
|
|
614
|
+
*/
|
|
615
|
+
style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject";
|
|
616
|
+
/**
|
|
617
|
+
* When this is true, property values of type array or object generate separate parameters
|
|
618
|
+
*/
|
|
619
|
+
explode?: boolean;
|
|
620
|
+
/**
|
|
621
|
+
* Determines whether the parameter value should be percent-encoded
|
|
622
|
+
*/
|
|
623
|
+
allowReserved?: boolean;
|
|
624
|
+
/**
|
|
625
|
+
* A map containing a mapping between property names and Encoding Objects
|
|
626
|
+
*/
|
|
627
|
+
encoding?: Record<string, EncodingObject>;
|
|
628
|
+
/**
|
|
629
|
+
* Encoding information for array prefixes
|
|
630
|
+
*/
|
|
631
|
+
prefixEncoding?: EncodingObject[];
|
|
632
|
+
/**
|
|
633
|
+
* Encoding information for array items
|
|
634
|
+
*/
|
|
635
|
+
itemEncoding?: EncodingObject;
|
|
636
|
+
} & SpecificationExtensions;
|
|
637
|
+
|
|
638
|
+
// ===============
|
|
639
|
+
// MARK: Examples
|
|
640
|
+
// ===============
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Shows an example of a schema
|
|
644
|
+
* $comment: https://spec.openapis.org/oas/v3.2#example-object
|
|
645
|
+
*/
|
|
646
|
+
export type ExampleObject = {
|
|
647
|
+
/**
|
|
648
|
+
* Short description for the example
|
|
649
|
+
*/
|
|
650
|
+
summary?: string;
|
|
651
|
+
/**
|
|
652
|
+
* Long description for the example
|
|
653
|
+
*/
|
|
654
|
+
description?: string;
|
|
655
|
+
/**
|
|
656
|
+
* Embedded literal example
|
|
657
|
+
*/
|
|
658
|
+
dataValue?: unknown;
|
|
659
|
+
/**
|
|
660
|
+
* A string representation of the example
|
|
661
|
+
*/
|
|
662
|
+
serializedValue?: string;
|
|
663
|
+
/**
|
|
664
|
+
* The example value
|
|
665
|
+
*/
|
|
666
|
+
value?: unknown;
|
|
667
|
+
/**
|
|
668
|
+
* A URL that points to the literal example
|
|
669
|
+
*/
|
|
670
|
+
externalValue?: string;
|
|
671
|
+
} & SpecificationExtensions;
|
|
672
|
+
|
|
673
|
+
// ===============
|
|
674
|
+
// MARK: Headers
|
|
675
|
+
// ===============
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* The Header Object follows the structure of the Parameter Object
|
|
679
|
+
* $comment: https://spec.openapis.org/oas/v3.2#header-object
|
|
680
|
+
*/
|
|
681
|
+
export type HeaderObject = {
|
|
682
|
+
/**
|
|
683
|
+
* A brief description of the header
|
|
684
|
+
*/
|
|
685
|
+
description?: string;
|
|
686
|
+
/**
|
|
687
|
+
* Determines whether this header is mandatory
|
|
688
|
+
*/
|
|
689
|
+
required?: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Specifies that a header is deprecated
|
|
692
|
+
*/
|
|
693
|
+
deprecated?: boolean;
|
|
694
|
+
/**
|
|
695
|
+
* The schema defining the type used for the header
|
|
696
|
+
*/
|
|
697
|
+
schema?: SchemaObject;
|
|
698
|
+
/**
|
|
699
|
+
* A map containing the representations for the header
|
|
700
|
+
*/
|
|
701
|
+
content?: ContentObject;
|
|
702
|
+
/**
|
|
703
|
+
* The style of the header (always "simple" for headers) */
|
|
704
|
+
style?: "simple";
|
|
705
|
+
/**
|
|
706
|
+
* When this is true, parameter values of type array or object generate separate parameters
|
|
707
|
+
*/
|
|
708
|
+
explode?: boolean;
|
|
709
|
+
/**
|
|
710
|
+
* Determines whether header value should be percent-encoded
|
|
711
|
+
*/
|
|
712
|
+
allowReserved?: boolean;
|
|
713
|
+
/**
|
|
714
|
+
* Example of the header's potential value
|
|
715
|
+
*/
|
|
716
|
+
example?: unknown;
|
|
717
|
+
/**
|
|
718
|
+
* Examples of the header's potential value
|
|
719
|
+
*/
|
|
720
|
+
examples?: Record<string, ExampleOrReferenceObject>;
|
|
721
|
+
} & SpecificationExtensions;
|
|
722
|
+
|
|
723
|
+
// ===============
|
|
724
|
+
// MARK: Links
|
|
725
|
+
// ===============
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* The Link Object represents a possible design-time link for a response
|
|
729
|
+
* $comment: https://spec.openapis.org/oas/v3.2#link-object
|
|
730
|
+
*/
|
|
731
|
+
export type LinkObject = {
|
|
732
|
+
/**
|
|
733
|
+
* A relative or absolute reference to an OAS operation
|
|
734
|
+
*/
|
|
735
|
+
operationRef?: string;
|
|
736
|
+
/**
|
|
737
|
+
* The name of an existing, resolvable OAS operation
|
|
738
|
+
*/
|
|
739
|
+
operationId?: string;
|
|
740
|
+
/**
|
|
741
|
+
* A map representing parameters to pass to an operation
|
|
742
|
+
*/
|
|
743
|
+
parameters?: MapOfString;
|
|
744
|
+
/**
|
|
745
|
+
* A literal value or runtime expression to use as a request body when calling the target operation
|
|
746
|
+
*/
|
|
747
|
+
requestBody?: unknown;
|
|
748
|
+
/**
|
|
749
|
+
* A description of the link
|
|
750
|
+
*/
|
|
751
|
+
description?: string;
|
|
752
|
+
/**
|
|
753
|
+
* A server object to be used by the target operation
|
|
754
|
+
*/
|
|
755
|
+
server?: ServerObject;
|
|
756
|
+
} & SpecificationExtensions;
|
|
757
|
+
|
|
758
|
+
// ===============
|
|
759
|
+
// MARK: Callbacks
|
|
760
|
+
// ===============
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* A map of possible out-of-band callbacks related to the parent operation
|
|
764
|
+
* $comment: https://spec.openapis.org/oas/v3.2#callback-object
|
|
765
|
+
*/
|
|
766
|
+
export type CallbacksObject = {
|
|
767
|
+
/**
|
|
768
|
+
* A path item object that contains the operation to call
|
|
769
|
+
*/
|
|
770
|
+
[callbackName: string]: PathItemObject;
|
|
771
|
+
} & SpecificationExtensions;
|
|
772
|
+
|
|
773
|
+
// ===============
|
|
774
|
+
// MARK: Security
|
|
775
|
+
// ===============
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* A list of security requirement objects that specify which security schemes can be used
|
|
779
|
+
* $comment: https://spec.openapis.org/oas/v3.2#security-requirement-object
|
|
780
|
+
*/
|
|
781
|
+
export interface SecurityRequirementObject {
|
|
782
|
+
/**
|
|
783
|
+
* Each name must correspond to a security scheme declared in the Security Schemes under the Components Object
|
|
784
|
+
*/
|
|
785
|
+
[securitySchemeName: string]: string[];
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Defines a security scheme that can be used by the operations
|
|
790
|
+
* $comment: https://spec.openapis.org/oas/v3.2#security-scheme-object
|
|
791
|
+
*/
|
|
792
|
+
export type SecuritySchemeObject = {
|
|
793
|
+
/**
|
|
794
|
+
* The type of the security scheme
|
|
795
|
+
*/
|
|
796
|
+
type: "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect";
|
|
797
|
+
/**
|
|
798
|
+
* A description for security scheme
|
|
799
|
+
*/
|
|
800
|
+
description?: string;
|
|
801
|
+
/**
|
|
802
|
+
* Declares this security scheme to be deprecated
|
|
803
|
+
*/
|
|
804
|
+
deprecated?: boolean;
|
|
805
|
+
/**
|
|
806
|
+
* The name of the header or query parameter to be used (apiKey type)
|
|
807
|
+
*/
|
|
808
|
+
name?: string;
|
|
809
|
+
/**
|
|
810
|
+
* The location of the API key (apiKey type)
|
|
811
|
+
*/
|
|
812
|
+
in?: "query" | "header" | "cookie";
|
|
813
|
+
/**
|
|
814
|
+
* The name of the HTTP Authorization scheme (http type)
|
|
815
|
+
*/
|
|
816
|
+
scheme?: string;
|
|
817
|
+
/**
|
|
818
|
+
* A hint to the client to identify how the bearer token is formatted (http bearer type)
|
|
819
|
+
*/
|
|
820
|
+
bearerFormat?: string;
|
|
821
|
+
/**
|
|
822
|
+
* An object containing configuration information for the flow types supported (oauth2 type)
|
|
823
|
+
*/
|
|
824
|
+
flows?: OAuthFlowsObject;
|
|
825
|
+
/**
|
|
826
|
+
* A URL to discover OAuth2 Authorization Server (oauth2 type)
|
|
827
|
+
*/
|
|
828
|
+
oauth2MetadataUrl?: string;
|
|
829
|
+
/**
|
|
830
|
+
* OpenID Connect URL to discover OAuth2 Authorization Server (openIdConnect type)
|
|
831
|
+
*/
|
|
832
|
+
openIdConnectUrl?: string;
|
|
833
|
+
} & SpecificationExtensions;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Configuration details for a supported OAuth Flow
|
|
837
|
+
*/
|
|
838
|
+
export type OAuthFlowsObject = {
|
|
839
|
+
/**
|
|
840
|
+
* Configuration for the OAuth Implicit flow
|
|
841
|
+
*/
|
|
842
|
+
implicit?: {
|
|
843
|
+
/** The authorization URL for the implicit flow */
|
|
844
|
+
authorizationUrl: string;
|
|
845
|
+
/** The URL to refresh token */
|
|
846
|
+
refreshUrl?: string;
|
|
847
|
+
/**
|
|
848
|
+
* The available scopes for the OAuth2 security scheme
|
|
849
|
+
*/
|
|
850
|
+
scopes: MapOfString;
|
|
851
|
+
};
|
|
852
|
+
/**
|
|
853
|
+
* Configuration for the OAuth Resource Owner Password flow
|
|
854
|
+
*/
|
|
855
|
+
password?: {
|
|
856
|
+
/** The token URL for the password flow */
|
|
857
|
+
tokenUrl: string;
|
|
858
|
+
/** The URL to refresh token */
|
|
859
|
+
refreshUrl?: string;
|
|
860
|
+
/**
|
|
861
|
+
* The available scopes for the OAuth2 security scheme
|
|
862
|
+
*/
|
|
863
|
+
scopes: MapOfString;
|
|
864
|
+
};
|
|
865
|
+
/**
|
|
866
|
+
* Configuration for the OAuth Client Credentials flow
|
|
867
|
+
*/
|
|
868
|
+
clientCredentials?: {
|
|
869
|
+
/** The token URL for the client credentials flow */
|
|
870
|
+
tokenUrl: string;
|
|
871
|
+
/** The URL to refresh token */
|
|
872
|
+
refreshUrl?: string;
|
|
873
|
+
/**
|
|
874
|
+
* The available scopes for the OAuth2 security scheme
|
|
875
|
+
*/
|
|
876
|
+
scopes: MapOfString;
|
|
877
|
+
};
|
|
878
|
+
/**
|
|
879
|
+
* Configuration for the OAuth Authorization Code flow
|
|
880
|
+
*/
|
|
881
|
+
authorizationCode?: {
|
|
882
|
+
/** The authorization URL for the authorization code flow */
|
|
883
|
+
authorizationUrl: string;
|
|
884
|
+
/** The token URL for the authorization code flow */
|
|
885
|
+
tokenUrl: string;
|
|
886
|
+
/** The URL to refresh token */
|
|
887
|
+
refreshUrl?: string;
|
|
888
|
+
/**
|
|
889
|
+
* The available scopes for the OAuth2 security scheme
|
|
890
|
+
*/
|
|
891
|
+
scopes: MapOfString;
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* Configuration for the OAuth Device Authorization flow
|
|
895
|
+
*/
|
|
896
|
+
deviceAuthorization?: {
|
|
897
|
+
/** The device authorization URL for the device authorization flow */
|
|
898
|
+
deviceAuthorizationUrl: string;
|
|
899
|
+
/** The token URL for the device authorization flow */
|
|
900
|
+
tokenUrl: string;
|
|
901
|
+
/** The URL to refresh token */
|
|
902
|
+
refreshUrl?: string;
|
|
903
|
+
/**
|
|
904
|
+
* The available scopes for the OAuth2 security scheme
|
|
905
|
+
*/
|
|
906
|
+
scopes: MapOfString;
|
|
907
|
+
};
|
|
908
|
+
} & SpecificationExtensions;
|
|
909
|
+
|
|
910
|
+
// ===============
|
|
911
|
+
// MARK: Tags and ExternalDocumentation
|
|
912
|
+
// ===============
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Adds metadata to a single tag that is used by the Operation Object
|
|
916
|
+
* $comment: https://spec.openapis.org/oas/v3.2#tag-object
|
|
917
|
+
*/
|
|
918
|
+
export type TagObject = {
|
|
919
|
+
/**
|
|
920
|
+
* The name of the tag
|
|
921
|
+
*/
|
|
922
|
+
name: string;
|
|
923
|
+
/**
|
|
924
|
+
* A short description for the tag
|
|
925
|
+
*/
|
|
926
|
+
summary?: string;
|
|
927
|
+
/**
|
|
928
|
+
* A description for the tag
|
|
929
|
+
*/
|
|
930
|
+
description?: string;
|
|
931
|
+
/**
|
|
932
|
+
* Additional external documentation for this tag
|
|
933
|
+
*/
|
|
934
|
+
externalDocs?: ExternalDocumentationObject;
|
|
935
|
+
/**
|
|
936
|
+
* The parent tag for hierarchical tags
|
|
937
|
+
*/
|
|
938
|
+
parent?: string;
|
|
939
|
+
/**
|
|
940
|
+
* The kind of tag
|
|
941
|
+
*/
|
|
942
|
+
kind?: string;
|
|
943
|
+
} & SpecificationExtensions;
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Allows referencing an external resource for extended documentation
|
|
947
|
+
* $comment: https://spec.openapis.org/oas/v3.2#external-documentation-object
|
|
948
|
+
*/
|
|
949
|
+
export type ExternalDocumentationObject = {
|
|
950
|
+
/**
|
|
951
|
+
* A short description of the target documentation
|
|
952
|
+
*/
|
|
953
|
+
description?: string;
|
|
954
|
+
/**
|
|
955
|
+
* The URL for the target documentation
|
|
956
|
+
*/
|
|
957
|
+
url: string;
|
|
958
|
+
} & SpecificationExtensions;
|
|
959
|
+
|
|
960
|
+
// ===============
|
|
961
|
+
// MARK: Reference Union Types
|
|
962
|
+
// ===============
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* Defines an object that is either a full ExampleObject or a Reference Object.
|
|
966
|
+
*/
|
|
967
|
+
export type ExampleOrReferenceObject = ExampleObject | ReferenceObject;
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Defines an object that is either a full Parameter Object or a Reference Object.
|
|
971
|
+
*/
|
|
972
|
+
export type ParameterOrReferenceObject = ParameterObject | ReferenceObject;
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* A request body or a reference to a request body
|
|
976
|
+
*/
|
|
977
|
+
export type RequestBodyOrReferenceObject = RequestBodyObject | ReferenceObject;
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Defines an object that is either a full Response Object or a Reference Object.
|
|
981
|
+
*/
|
|
982
|
+
export type ResponseOrReferenceObject = ResponseObject | ReferenceObject;
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* Defines an object that is either a full Header Object or a Reference Object.
|
|
986
|
+
*/
|
|
987
|
+
export type HeaderOrReferenceObject = HeaderObject | ReferenceObject;
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* A link or a reference to a link
|
|
991
|
+
*/
|
|
992
|
+
export type LinkOrReferenceObject = LinkObject | ReferenceObject;
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* A media type or a reference to a media type
|
|
996
|
+
*/
|
|
997
|
+
export type MediaTypeOrReferenceObject = MediaTypeObject | ReferenceObject;
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* A type that can be either the direct type or a reference
|
|
1001
|
+
*/
|
|
1002
|
+
export type PossiblyReferenced<T> = T | ReferenceObject;
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* A security scheme or a reference to a security scheme
|
|
1006
|
+
*/
|
|
1007
|
+
export type SecuritySchemeOrReferenceObject =
|
|
1008
|
+
| SecuritySchemeObject
|
|
1009
|
+
| ReferenceObject;
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* A callback or a reference to a callback
|
|
1013
|
+
*/
|
|
1014
|
+
export type CallbacksOrReferenceObject = CallbacksObject | ReferenceObject;
|
|
1015
|
+
|
|
1016
|
+
// ===============
|
|
1017
|
+
// MARK: OpenAPIDocument
|
|
1018
|
+
// ===============
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* The root document object for the OpenAPI Specification
|
|
1022
|
+
* Contains all the information about the API
|
|
1023
|
+
*/
|
|
1024
|
+
export type OpenAPIDocumentProperties = {
|
|
1025
|
+
/**
|
|
1026
|
+
* The OpenAPI version string
|
|
1027
|
+
* Must be in format "3.2.x" or "3.2.x-..."
|
|
1028
|
+
*/
|
|
1029
|
+
openapi: string;
|
|
1030
|
+
/**
|
|
1031
|
+
* A self-reference to the document
|
|
1032
|
+
* MUST NOT contain a fragment
|
|
1033
|
+
*/
|
|
1034
|
+
$self?: string;
|
|
1035
|
+
/**
|
|
1036
|
+
* Provides metadata about the API
|
|
1037
|
+
*/
|
|
1038
|
+
info: InfoObject;
|
|
1039
|
+
/**
|
|
1040
|
+
* The default JSON Schema dialect for operations
|
|
1041
|
+
* @default https://spec.openapis.org/oas/3.2/dialect/2025-09-17
|
|
1042
|
+
*/
|
|
1043
|
+
jsonSchemaDialect?: string;
|
|
1044
|
+
/**
|
|
1045
|
+
* An array of Server Objects
|
|
1046
|
+
* Provides connectivity information to a target server
|
|
1047
|
+
*/
|
|
1048
|
+
servers?: ServerObject[];
|
|
1049
|
+
/**
|
|
1050
|
+
* The available paths and operations for the API
|
|
1051
|
+
*/
|
|
1052
|
+
paths?: PathsObject;
|
|
1053
|
+
/**
|
|
1054
|
+
* A map of possible out-of-band callbacks
|
|
1055
|
+
* Key is the name of the callback
|
|
1056
|
+
*/
|
|
1057
|
+
webhooks?: Record<string, PathItemObject>;
|
|
1058
|
+
/**
|
|
1059
|
+
* An element to hold various reusable objects
|
|
1060
|
+
* Can include schemas, parameters, responses, etc.
|
|
1061
|
+
*/
|
|
1062
|
+
components?: ComponentsObject;
|
|
1063
|
+
/**
|
|
1064
|
+
* A declaration of which security mechanisms can be used
|
|
1065
|
+
*/
|
|
1066
|
+
security?: SecurityRequirementObject[];
|
|
1067
|
+
/**
|
|
1068
|
+
* A list of tags used by the specification
|
|
1069
|
+
* Can be used for grouping operations
|
|
1070
|
+
*/
|
|
1071
|
+
tags?: TagObject[];
|
|
1072
|
+
/**
|
|
1073
|
+
* Additional external documentation
|
|
1074
|
+
*/
|
|
1075
|
+
externalDocs?: ExternalDocumentationObject;
|
|
1076
|
+
} & SpecificationExtensions;
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* OpenAPI document that includes paths
|
|
1080
|
+
* One of the required combinations for a valid OpenAPI document
|
|
1081
|
+
*/
|
|
1082
|
+
export type OpenAPIDocumentWithPaths = SchemaObject &
|
|
1083
|
+
OpenAPIDocumentProperties & {
|
|
1084
|
+
paths: PathsObject;
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* OpenAPI document that includes components
|
|
1089
|
+
* One of the required combinations for a valid OpenAPI document
|
|
1090
|
+
*/
|
|
1091
|
+
export type OpenAPIDocumentWithComponents = SchemaObject &
|
|
1092
|
+
OpenAPIDocumentProperties & {
|
|
1093
|
+
components: ComponentsObject;
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* OpenAPI document that includes webhooks
|
|
1098
|
+
* One of the required combinations for a valid OpenAPI document
|
|
1099
|
+
*/
|
|
1100
|
+
export type OpenAPIDocumentWithWebhooks = SchemaObject &
|
|
1101
|
+
OpenAPIDocumentProperties & {
|
|
1102
|
+
webhooks: Record<string, PathItemObject>;
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* Complete OpenAPI document type
|
|
1107
|
+
* Must include at least one of: paths, components, or webhooks
|
|
1108
|
+
*/
|
|
1109
|
+
export type OpenAPIDocument =
|
|
1110
|
+
| OpenAPIDocumentWithPaths
|
|
1111
|
+
| OpenAPIDocumentWithComponents
|
|
1112
|
+
| OpenAPIDocumentWithWebhooks;
|