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