@hasagi/schema 0.7.0 → 0.7.1

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.
@@ -1,944 +0,0 @@
1
- /**
2
- * This is the root document object of the OpenAPI document.
3
- */
4
- export interface OpenAPIObject {
5
- /**
6
- * REQUIRED. This string MUST be the semantic version number
7
- * of the OpenAPI Specification version that the OpenAPI document uses.
8
- * The openapi field SHOULD be used by tooling specifications and clients
9
- * to interpret the OpenAPI document. This is not related to the API info.version string.
10
- */
11
- openapi: string;
12
-
13
- /**
14
- * REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required.
15
- */
16
- info: InfoObject;
17
-
18
- /**
19
- * An array of Server Objects, which provide connectivity information
20
- * to a target server. If the servers property is not provided, or is an empty array,
21
- * the default value would be a Server Object with a url value of /.
22
- */
23
- servers?: ServerObject[];
24
-
25
- /**
26
- * REQUIRED. The available paths and operations for the API.
27
- */
28
- paths: PathsObject;
29
-
30
- /**
31
- * An element to hold various schemas for the specification.
32
- */
33
- components?: ComponentsObject;
34
-
35
- /**
36
- * A declaration of which security mechanisms can be used across the API.
37
- * The list of values includes alternative security requirement objects that can be used.
38
- * Only one of the security requirement objects need to be satisfied to authorize a request.
39
- * Individual operations can override this definition. To make security optional,
40
- * an empty security requirement ({}) can be included in the array.
41
- */
42
- security?: SecurityRequirementObject[];
43
-
44
- /**
45
- * A list of tags used by the specification with additional metadata.
46
- * The order of the tags can be used to reflect on their order by the parsing tools.
47
- * Not all tags that are used by the Operation Object must be declared.
48
- * The tags that are not declared MAY be organized randomly or based on the tools’ logic.
49
- * Each tag name in the list MUST be unique.
50
- */
51
- tags?: TagObject[];
52
-
53
- /**
54
- * Additional external documentation.
55
- */
56
- externalDocs?: ExternalDocumentationObject;
57
- }
58
-
59
- /**
60
- * Info Object provides metadata about the API.
61
- * The metadata MAY be used by the clients if needed, and MAY be presented
62
- * in editing or documentation generation tools for convenience.
63
- */
64
- export interface InfoObject {
65
- /**
66
- * REQUIRED. The title of the API.
67
- */
68
- title: string;
69
-
70
- /**
71
- * A short description of the API.
72
- * CommonMark syntax MAY be used for rich text representation.
73
- */
74
- description?: string;
75
-
76
- /**
77
- * A URL to the Terms of Service for the API. MUST be in the format of a URL.
78
- */
79
- termsOfService?: string;
80
-
81
- /**
82
- * The contact information for the exposed API.
83
- */
84
- contact?: ContactObject;
85
-
86
- /**
87
- * The license information for the exposed API.
88
- */
89
- license?: LicenseObject;
90
-
91
- /**
92
- * REQUIRED. The version of the OpenAPI document
93
- * (which is distinct from the OpenAPI Specification version or the API implementation version).
94
- */
95
- version: string;
96
- }
97
-
98
- /**
99
- * Contact Object provides contact information for the exposed API.
100
- */
101
- export interface ContactObject {
102
- /**
103
- * The identifying name of the contact person/organization.
104
- */
105
- name?: string;
106
-
107
- /**
108
- * The URL pointing to the contact information. MUST be in the format of a URL.
109
- */
110
- url?: string;
111
-
112
- /**
113
- * The email address of the contact person/organization. MUST be in the format of an email address.
114
- */
115
- email?: string;
116
- }
117
-
118
- /**
119
- * License Object provides license information for the exposed API.
120
- */
121
- export interface LicenseObject {
122
- /**
123
- * REQUIRED. The license name used for the API.
124
- */
125
- name: string;
126
-
127
- /**
128
- * A URL to the license used for the API. MUST be in the format of a URL.
129
- */
130
- url?: string;
131
- }
132
-
133
- /**
134
- * Server Object represents a Server.
135
- */
136
- export interface ServerObject {
137
- /**
138
- * REQUIRED. A URL to the target host. This URL supports Server Variables
139
- * and MAY be relative, to indicate that the host location is relative
140
- * to the location where the OpenAPI document is being served.
141
- * Variable substitutions will be made when a variable is named in {brackets}.
142
- */
143
- url: string;
144
-
145
- /**
146
- * An optional string describing the host designated by the URL.
147
- * CommonMark syntax MAY be used for rich text representation.
148
- */
149
- description?: string;
150
-
151
- /**
152
- * A map between a variable name and its value.
153
- * The value is used for substitution in the server’s URL template.
154
- */
155
- variables?: Record<string, ServerVariableObject>;
156
- }
157
-
158
- /**
159
- * Server Variable Object represents a Server Variable for server URL template substitution.
160
- */
161
- export interface ServerVariableObject {
162
- /**
163
- * An enumeration of string values to be used if the substitution options
164
- * are from a limited set. The array SHOULD NOT be empty.
165
- */
166
- enum?: string[];
167
-
168
- /**
169
- * REQUIRED. The default value to use for substitution, which SHALL be sent
170
- * if an alternate value is not supplied. Note this behavior is different
171
- * than the Schema Object’s treatment of default values because in those cases
172
- * parameter values are optional. If the enum is defined, the value SHOULD
173
- * exist in the enum’s values.
174
- */
175
- default: string;
176
-
177
- /**
178
- * An optional description for the server variable.
179
- * CommonMark syntax MAY be used for rich text representation.
180
- */
181
- description?: string;
182
- }
183
-
184
- /**
185
- * Components Object holds a set of reusable objects for different aspects of the OAS.
186
- * All objects defined within the components object will have no effect on the API
187
- * unless they are explicitly referenced from properties outside the components object.
188
- */
189
- export interface ComponentsObject {
190
- /**
191
- * An object to hold reusable Schema Objects.
192
- */
193
- schemas?: Record<string, SchemaObject | ReferenceObject>;
194
-
195
- /**
196
- * An object to hold reusable Response Objects.
197
- */
198
- responses?: Record<string, ResponseObject | ReferenceObject>;
199
-
200
- /**
201
- * An object to hold reusable Parameter Objects.
202
- */
203
- parameters?: Record<string, ParameterObject | ReferenceObject>;
204
-
205
- /**
206
- * An object to hold reusable Example Objects.
207
- */
208
- examples?: Record<string, ExampleObject | ReferenceObject>;
209
-
210
- /**
211
- * An object to hold reusable Request Body Objects.
212
- */
213
- requestBodies?: Record<string, RequestBodyObject | ReferenceObject>;
214
-
215
- /**
216
- * An object to hold reusable Header Objects.
217
- */
218
- headers?: Record<string, HeaderObject | ReferenceObject>;
219
-
220
- /**
221
- * An object to hold reusable Security Scheme Objects.
222
- */
223
- securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
224
-
225
- /**
226
- * An object to hold reusable Link Objects.
227
- */
228
- links?: Record<string, LinkObject | ReferenceObject>;
229
-
230
- /**
231
- * An object to hold reusable Callback Objects.
232
- */
233
- callbacks?: Record<string, CallbackObject | ReferenceObject>;
234
- }
235
-
236
- /**
237
- * Paths Object holds the relative paths to the individual endpoints and their operations.
238
- * The Paths MAY be empty, due to ACL constraints.
239
- */
240
- export interface PathsObject {
241
- /**
242
- * Patterned Fields represent relative paths to individual endpoints.
243
- * The field name MUST begin with a forward slash (/).
244
- * Path templating is allowed. When matching URLs, concrete (non-templated) paths
245
- * would be matched before their templated counterparts.
246
- */
247
- [path: string]: PathItemObject;
248
- }
249
-
250
- /**
251
- * Path Item Object describes the operations available on a single path.
252
- * A Path Item MAY be empty, due to ACL constraints.
253
- */
254
- export interface PathItemObject {
255
- /**
256
- * Allows for an external definition of this path item.
257
- * The referenced structure MUST be in the format of a Path Item Object.
258
- */
259
- $ref?: string;
260
-
261
- /**
262
- * An optional, string summary, intended to apply to all operations in this path.
263
- */
264
- summary?: string;
265
-
266
- /**
267
- * An optional, string description, intended to apply to all operations in this path.
268
- * CommonMark syntax MAY be used for rich text representation.
269
- */
270
- description?: string;
271
-
272
- /**
273
- * A definition of a GET operation on this path.
274
- */
275
- get?: OperationObject;
276
-
277
- /**
278
- * A definition of a PUT operation on this path.
279
- */
280
- put?: OperationObject;
281
-
282
- /**
283
- * A definition of a POST operation on this path.
284
- */
285
- post?: OperationObject;
286
-
287
- /**
288
- * A definition of a DELETE operation on this path.
289
- */
290
- delete?: OperationObject;
291
-
292
- /**
293
- * A definition of an OPTIONS operation on this path.
294
- */
295
- options?: OperationObject;
296
-
297
- /**
298
- * A definition of a HEAD operation on this path.
299
- */
300
- head?: OperationObject;
301
-
302
- /**
303
- * A definition of a PATCH operation on this path.
304
- */
305
- patch?: OperationObject;
306
-
307
- /**
308
- * A definition of a TRACE operation on this path.
309
- */
310
- trace?: OperationObject;
311
-
312
- /**
313
- * An alternative server array to service all operations in this path.
314
- */
315
- servers?: ServerObject[];
316
-
317
- /**
318
- * A list of parameters that are applicable for all the operations described under this path.
319
- * These parameters can be overridden at the operation level, but cannot be removed there.
320
- * The list MUST NOT include duplicated parameters.
321
- */
322
- parameters?: (ParameterObject | ReferenceObject)[];
323
- }
324
-
325
- /**
326
- * Operation Object describes a single API operation on a path.
327
- */
328
- export interface OperationObject {
329
- /**
330
- * A list of tags for API documentation control.
331
- * Tags can be used for logical grouping of operations by resources or any other qualifier.
332
- */
333
- tags?: string[];
334
-
335
- /**
336
- * A short summary of what the operation does.
337
- */
338
- summary?: string;
339
-
340
- /**
341
- * A verbose explanation of the operation behavior.
342
- * CommonMark syntax MAY be used for rich text representation.
343
- */
344
- description?: string;
345
-
346
- /**
347
- * Additional external documentation for this operation.
348
- */
349
- externalDocs?: ExternalDocumentationObject;
350
-
351
- /**
352
- * Unique string used to identify the operation.
353
- * The id MUST be unique among all operations described in the API.
354
- * The operationId value is case-sensitive.
355
- */
356
- operationId?: string;
357
-
358
- /**
359
- * A list of parameters that are applicable for this operation.
360
- * If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
361
- * The list MUST NOT include duplicated parameters.
362
- */
363
- parameters?: (ParameterObject | ReferenceObject)[];
364
-
365
- /**
366
- * The request body applicable for this operation.
367
- * The requestBody is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231] has explicitly defined semantics for request bodies.
368
- * In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.
369
- */
370
- requestBody?: RequestBodyObject | ReferenceObject;
371
-
372
- /**
373
- * REQUIRED. The list of possible responses as they are returned from executing this operation.
374
- */
375
- responses: ResponsesObject;
376
-
377
- /**
378
- * A map of possible out-of-band callbacks related to the parent operation.
379
- * The key is a unique identifier for the Callback Object.
380
- * Each value in the map is a Callback Object that describes a request that may be initiated by the API provider and the expected responses.
381
- */
382
- callbacks?: Record<string, CallbackObject | ReferenceObject>;
383
-
384
- /**
385
- * Declares this operation to be deprecated.
386
- * Consumers SHOULD refrain from usage of the declared operation. Default value is false.
387
- */
388
- deprecated?: boolean;
389
-
390
- /**
391
- * A declaration of which security mechanisms can be used for this operation.
392
- * The list of values includes alternative security requirement objects that can be used.
393
- * Only one of the security requirement objects need to be satisfied to authorize a request.
394
- * To make security optional, an empty security requirement ({}) can be included in the array.
395
- * This definition overrides any declared top-level security.
396
- */
397
- security?: SecurityRequirementObject[];
398
-
399
- /**
400
- * An alternative server array to service this operation.
401
- * If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by this value.
402
- */
403
- servers?: ServerObject[];
404
- }
405
-
406
- /**
407
- * External Documentation Object allows referencing an external resource for extended documentation.
408
- */
409
- export interface ExternalDocumentationObject {
410
- /**
411
- * A short description of the target documentation.
412
- * CommonMark syntax MAY be used for rich text representation.
413
- */
414
- description?: string;
415
-
416
- /**
417
- * REQUIRED. The URL for the target documentation.
418
- * Value MUST be in the format of a URL.
419
- */
420
- url: string;
421
- }
422
-
423
- /**
424
- * Parameter Object describes a single operation parameter.
425
- * A unique parameter is defined by a combination of a name and location.
426
- */
427
- export interface ParameterObject {
428
- /**
429
- * REQUIRED. The name of the parameter.
430
- * Parameter names are case sensitive.
431
- *
432
- * - If in is "path", the name field MUST correspond to a template expression occurring within the path field in the Paths Object.
433
- * - If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition SHALL be ignored.
434
- * - For all other cases, the name corresponds to the parameter name used by the in property.
435
- */
436
- name: string;
437
-
438
- /**
439
- * REQUIRED. The location of the parameter.
440
- * Possible values are "query", "header", "path", or "cookie".
441
- */
442
- in: "query" | "header" | "path" | "cookie";
443
-
444
- /**
445
- * A brief description of the parameter.
446
- * This could contain examples of use.
447
- * CommonMark syntax MAY be used for rich text representation.
448
- */
449
- description?: string;
450
-
451
- /**
452
- * Determines whether this parameter is mandatory.
453
- * If the parameter location is "path", this property is REQUIRED and its value MUST be true.
454
- * Otherwise, the property MAY be included, and its default value is false.
455
- */
456
- required?: boolean;
457
-
458
- /**
459
- * Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.
460
- * Default value is false.
461
- */
462
- deprecated?: boolean;
463
-
464
- /**
465
- * Sets the ability to pass empty-valued parameters.
466
- * This is valid only for query parameters and allows sending a parameter with an empty value.
467
- * Default value is false.
468
- * If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored.
469
- * Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision.
470
- */
471
- allowEmptyValue?: boolean;
472
-
473
- /**
474
- * Describes how the parameter value will be serialized depending on the type of the parameter value.
475
- * Default values (based on value of in): for query - "form"; for path - "simple"; for header - "simple"; for cookie - "form".
476
- */
477
- style?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject";
478
-
479
- /**
480
- * When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.
481
- * For other types of parameters, this property has no effect.
482
- * When style is "form", the default value is true.
483
- * For all other styles, the default value is false.
484
- */
485
- explode?: boolean;
486
-
487
- /**
488
- * Determines whether the parameter value SHOULD allow reserved characters.
489
- * This property only applies to parameters with an in value of query.
490
- * The default value is false.
491
- */
492
- allowReserved?: boolean;
493
-
494
- /**
495
- * The schema defining the type used for the parameter.
496
- */
497
- schema?: SchemaObject | ReferenceObject;
498
-
499
- /**
500
- * Example of the parameter’s potential value.
501
- * The example SHOULD match the specified schema and encoding properties if present.
502
- * The example field is mutually exclusive of the examples field.
503
- * Furthermore, if referencing a schema that contains an example, the example value SHALL override the example provided by the schema.
504
- * To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
505
- */
506
- example?: any;
507
-
508
- /**
509
- * Examples of the parameter’s potential value.
510
- * Each example SHOULD contain a value in the correct format as specified in the parameter encoding.
511
- * The examples field is mutually exclusive of the example field.
512
- * Furthermore, if referencing a schema that contains an example, the examples value SHALL override the example provided by the schema.
513
- */
514
- examples?: Record<string, ExampleObject | ReferenceObject>;
515
-
516
- /**
517
- * A map containing the representations for the parameter.
518
- * The key is the media type and the value describes it.
519
- * The map MUST only contain one entry.
520
- */
521
- content?: Record<string, MediaTypeObject>;
522
- }
523
-
524
- /**
525
- * Request Body Object describes a single request body.
526
- */
527
- export interface RequestBodyObject {
528
- /**
529
- * A brief description of the request body.
530
- * This could contain examples of use.
531
- * CommonMark syntax MAY be used for rich text representation.
532
- */
533
- description?: string;
534
-
535
- /**
536
- * REQUIRED. The content of the request body.
537
- * The key is a media type or media type range, and the value describes it.
538
- * For requests that match multiple keys, only the most specific key is applicable.
539
- * e.g. text/plain overrides text/*
540
- */
541
- content: Record<string, MediaTypeObject>;
542
-
543
- /**
544
- * Determines if the request body is required in the request.
545
- * Defaults to false.
546
- */
547
- required?: boolean;
548
- }
549
-
550
- /**
551
- * Media Type Object provides schema and examples for the media type identified by its key.
552
- */
553
- export interface MediaTypeObject {
554
- /**
555
- * The schema defining the content of the request, response, or parameter.
556
- */
557
- schema?: SchemaObject | ReferenceObject;
558
-
559
- /**
560
- * Example of the media type.
561
- * The example object SHOULD be in the correct format as specified by the media type.
562
- * The example field is mutually exclusive of the examples field.
563
- * Furthermore, if referencing a schema that contains an example, the example value SHALL override the example provided by the schema.
564
- */
565
- example?: any;
566
-
567
- /**
568
- * Examples of the media type.
569
- * Each example object SHOULD match the media type and specified schema if present.
570
- * The examples field is mutually exclusive of the example field.
571
- * Furthermore, if referencing a schema that contains an example, the examples value SHALL override the example provided by the schema.
572
- */
573
- examples?: Record<string, ExampleObject | ReferenceObject>;
574
-
575
- /**
576
- * A map between a property name and its encoding information.
577
- * The key, being the property name, MUST exist in the schema as a property.
578
- * The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded.
579
- */
580
- encoding?: Record<string, EncodingObject>;
581
- }
582
-
583
- /**
584
- * Encoding Object is a single encoding definition applied to a single schema property.
585
- */
586
- export interface EncodingObject {
587
- /**
588
- * The Content-Type for encoding a specific property.
589
- * Default value depends on the property type:
590
- * - for string with format being binary – application/octet-stream
591
- * - for other primitive types – text/plain
592
- * - for object - application/json
593
- * - for array – the default is defined based on the inner type.
594
- * The value can be a specific media type (e.g., application/json), a wildcard media type (e.g., image/*),
595
- * or a comma-separated list of the two types.
596
- */
597
- contentType?: string;
598
-
599
- /**
600
- * A map allowing additional information to be provided as headers, for example, Content-Disposition.
601
- * Content-Type is described separately and SHALL be ignored in this section.
602
- * This property SHALL be ignored if the request body media type is not multipart.
603
- */
604
- headers?: Record<string, HeaderObject | ReferenceObject>;
605
-
606
- /**
607
- * Describes how a specific property value will be serialized depending on its type.
608
- * See Parameter Object for details on the style property.
609
- * The behavior follows the same values as query parameters, including default values.
610
- * This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded.
611
- */
612
- style?: string;
613
-
614
- /**
615
- * When this is true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map.
616
- * For other types of properties, this property has no effect.
617
- * When style is "form", the default value is true.
618
- * For all other styles, the default value is false.
619
- * This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded.
620
- */
621
- explode?: boolean;
622
-
623
- /**
624
- * Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986] :/?#[]@!$&'()*+,;= to be included without percent-encoding.
625
- * The default value is false.
626
- * This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded.
627
- */
628
- allowReserved?: boolean;
629
- }
630
-
631
- /**
632
- * Response Object describes a single response from an API Operation, including design-time, static links to operations based on the response.
633
- */
634
- export interface ResponseObject {
635
- /**
636
- * REQUIRED. A short description of the response.
637
- * CommonMark syntax MAY be used for rich text representation.
638
- */
639
- description: string;
640
-
641
- /**
642
- * Maps a header name to its definition.
643
- * [RFC7230] states header names are case insensitive.
644
- * If a response header is defined with the name "Content-Type", it SHALL be ignored.
645
- */
646
- headers?: Record<string, HeaderObject | ReferenceObject>;
647
-
648
- /**
649
- * A map containing descriptions of potential response payloads.
650
- * The key is a media type or media type range, and the value describes it.
651
- * For responses that match multiple keys, only the most specific key is applicable.
652
- * e.g. text/plain overrides text/*
653
- */
654
- content?: Record<string, MediaTypeObject>;
655
-
656
- /**
657
- * A map of operations links that can be followed from the response.
658
- * The key of the map is a short name for the link, following the naming constraints of the names for Component Objects.
659
- */
660
- links?: Record<string, LinkObject | ReferenceObject>;
661
- }
662
-
663
- /**
664
- * Callback Object represents a map of possible out-of-band callbacks related to the parent operation.
665
- * Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses.
666
- * The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
667
- */
668
- export interface CallbackObject {
669
- [expression: string]: PathItemObject;
670
- }
671
-
672
- /**
673
- * Example Object represents an example in the API documentation.
674
- */
675
- export interface ExampleObject {
676
- summary?: string; // Short description for the example
677
- description?: string; // Long description for the example
678
- value?: any; // Embedded literal example
679
- externalValue?: string; // A URL that points to the literal example
680
- }
681
-
682
- /**
683
- * Link Object represents a possible design-time link for a response.
684
- */
685
- export interface LinkObject {
686
- operationRef?: string; // A relative or absolute URI reference to an OAS operation
687
- operationId?: string; // The name of an existing, resolvable OAS operation
688
- parameters?: { [name: string]: any | { expression: string } }; // Parameters to pass to the linked operation
689
- requestBody?: any | { expression: string }; // Request body to use when calling the target operation
690
- description?: string; // A description of the link
691
- server?: ServerObject; // A server object to be used by the target operation
692
- }
693
-
694
- /**
695
- * Header Object represents a header parameter in the API documentation.
696
- */
697
- export interface HeaderObject {
698
- description?: string; // A brief description of the header
699
- required?: boolean; // Determines whether this header is mandatory
700
- deprecated?: boolean; // Specifies that a header is deprecated
701
- allowEmptyValue?: boolean; // Sets the ability to pass empty-valued headers
702
- style?: string; // Describes how the header value will be serialized
703
- explode?: boolean; // When true, header values generate separate parameters
704
- allowReserved?: boolean; // Determines whether the header value SHOULD allow reserved characters
705
- schema?: SchemaObject | ReferenceObject; // The schema defining the type used for the header
706
- example?: any; // Example of the header's potential value
707
- examples?: { [key: string]: ExampleObject | ReferenceObject }; // Examples of the header's potential value
708
- }
709
-
710
- /**
711
- * Tag Object adds metadata to a single tag that is used by the Operation Object.
712
- */
713
- export interface TagObject {
714
- name: string; // The name of the tag
715
- description?: string; // A short description for the tag
716
- externalDocs?: ExternalDocumentationObject; // Additional external documentation for this tag
717
- }
718
-
719
- /**
720
- * Reference Object allows referencing other components in the specification.
721
- */
722
- export interface ReferenceObject {
723
- $ref: string; // The reference string
724
- }
725
-
726
- /**
727
- * Schema Object represents a data type definition.
728
- */
729
- export interface SchemaObject {
730
- title?: string;
731
- multipleOf?: number;
732
- maximum?: number;
733
- exclusiveMaximum?: boolean;
734
- minimum?: number;
735
- exclusiveMinimum?: boolean;
736
- maxLength?: number;
737
- minLength?: number;
738
- pattern?: string; // Regular expression
739
- maxItems?: number;
740
- minItems?: number;
741
- uniqueItems?: boolean;
742
- maxProperties?: number;
743
- minProperties?: number;
744
- required?: string[];
745
- enum?: any[];
746
-
747
- type?: string; // Single type, multiple types not supported
748
- allOf?: (SchemaObject | ReferenceObject)[]; // Array of Schema Objects or Reference Objects
749
- oneOf?: (SchemaObject | ReferenceObject)[]; // Array of Schema Objects or Reference Objects
750
- anyOf?: (SchemaObject | ReferenceObject)[]; // Array of Schema Objects or Reference Objects
751
- not?: SchemaObject | ReferenceObject; // Schema Object or Reference Object
752
- items?: SchemaObject | ReferenceObject; // Schema Object or Reference Object
753
- properties?: { [key: string]: SchemaObject | ReferenceObject }; // Map of property names to Schema Objects or Reference Objects
754
- additionalProperties?: boolean | SchemaObject | ReferenceObject; // Boolean or Schema Object or Reference Object
755
- description?: string;
756
- format?: string;
757
- default?: any;
758
-
759
- nullable?: boolean;
760
- discriminator?: DiscriminatorObject;
761
- readOnly?: boolean;
762
- writeOnly?: boolean;
763
- xml?: XMLObject;
764
- externalDocs?: ExternalDocumentationObject;
765
- example?: any;
766
- deprecated?: boolean;
767
- }
768
-
769
- /**
770
- * Reference Object allows referencing other components in the specification.
771
- */
772
- export interface ReferenceObject {
773
- $ref: string; // The reference string
774
- }
775
-
776
- /**
777
- * Discriminator Object for polymorphism.
778
- */
779
- export interface DiscriminatorObject {
780
- propertyName: string; // The name of the property that decides which schema definition validates the structure
781
- mapping?: { [key: string]: string }; // A map that provides the schema name to use for a given discriminator value
782
- }
783
-
784
- /**
785
- * XML Object for describing the XML representation of a schema property.
786
- */
787
- export interface XMLObject {
788
- name?: string; // The name of the XML element when serialized
789
- namespace?: string; // The XML namespace
790
- prefix?: string; // The prefix to use for the XML element
791
- attribute?: boolean; // Indicates if the property should be serialized as an attribute
792
- wrapped?: boolean; // Indicates if the property should be wrapped in an XML element
793
- }
794
-
795
- /**
796
- * External Documentation Object for providing additional external documentation.
797
- */
798
- export interface ExternalDocumentationObject {
799
- description?: string; // A short description of the external documentation
800
- url: string; // The URL for the external documentation
801
- }
802
-
803
- // Additional types needed for completeness
804
- type SchemaType =
805
- | 'array'
806
- | 'boolean'
807
- | 'integer'
808
- | 'number'
809
- | 'object'
810
- | 'string';
811
-
812
- /**
813
- * Responses Object describes the expected responses of an operation.
814
- */
815
- export interface ResponsesObject {
816
- default?: ResponseObject | ReferenceObject;
817
- [statusCode: string]: ResponseObject | ReferenceObject | undefined;
818
- }
819
-
820
- /**
821
- * Security Requirement Object lists the required security schemes to execute this operation.
822
- */
823
- export interface SecurityRequirementObject {
824
- [schemeName: string]: string[]; // Key is the security scheme name, value is a list of required scopes
825
- }
826
-
827
- /**
828
- * Defines a security scheme that can be used by the operations.
829
- * Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter, or as a query parameter),
830
- * OAuth2’s common flows (implicit, password, client credentials, and authorization code) as defined in RFC6749,
831
- * and OpenID Connect Discovery.
832
- */
833
- export interface SecuritySchemeObject {
834
- /**
835
- * The type of the security scheme.
836
- * Valid values are "apiKey", "http", "oauth2", "openIdConnect".
837
- * @required
838
- */
839
- type: "apiKey" | "http" | "oauth2" | "openIdConnect";
840
-
841
- /**
842
- * A short description for the security scheme.
843
- * CommonMark syntax MAY be used for rich text representation.
844
- */
845
- description?: string;
846
-
847
- /**
848
- * The name of the header, query, or cookie parameter to be used when using an API key for authentication.
849
- * @required for type "apiKey"
850
- */
851
- name?: string;
852
-
853
- /**
854
- * The location of the API key.
855
- * Valid values are "query", "header", or "cookie".
856
- * @required for type "apiKey"
857
- */
858
- in?: "query" | "header" | "cookie";
859
-
860
- /**
861
- * The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.
862
- * The values used SHOULD be registered in the IANA Authentication Scheme registry.
863
- * @required for type "http"
864
- */
865
- scheme?: string;
866
-
867
- /**
868
- * A hint to the client to identify how the bearer token is formatted.
869
- * Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
870
- * @required for type "http" with the "bearer" scheme
871
- */
872
- bearerFormat?: string;
873
-
874
- /**
875
- * An object containing configuration information for the flow types supported.
876
- * @required for type "oauth2"
877
- */
878
- flows?: OAuthFlowsObject;
879
-
880
- /**
881
- * OpenID Connect URL to discover OAuth2 configuration values.
882
- * This MUST be in the form of a URL.
883
- * @required for type "openIdConnect"
884
- */
885
- openIdConnectUrl?: string;
886
- }
887
-
888
- /**
889
- * Configuration details for a supported OAuth Flow.
890
- */
891
- export interface OAuthFlowObject {
892
- /**
893
- * The authorization URL to be used for this flow.
894
- * This MUST be in the form of a URL.
895
- * @required for flow types "implicit" and "authorizationCode"
896
- */
897
- authorizationUrl?: string;
898
-
899
- /**
900
- * The token URL to be used for this flow.
901
- * This MUST be in the form of a URL.
902
- * @required for flow types "password", "clientCredentials", and "authorizationCode"
903
- */
904
- tokenUrl?: string;
905
-
906
- /**
907
- * The URL to be used for obtaining refresh tokens.
908
- * This MUST be in the form of a URL.
909
- */
910
- refreshUrl?: string;
911
-
912
- /**
913
- * The available scopes for the OAuth2 security scheme.
914
- * A map between the scope name and a short description for it.
915
- * The map MAY be empty.
916
- * @required
917
- */
918
- scopes: Record<string, string>;
919
- }
920
-
921
- /**
922
- * Allows configuration of the supported OAuth Flows.
923
- */
924
- export interface OAuthFlowsObject {
925
- /**
926
- * Configuration for the OAuth Implicit flow.
927
- */
928
- implicit?: OAuthFlowObject;
929
-
930
- /**
931
- * Configuration for the OAuth Resource Owner Password flow.
932
- */
933
- password?: OAuthFlowObject;
934
-
935
- /**
936
- * Configuration for the OAuth Client Credentials flow (previously called "application" in OpenAPI 2.0).
937
- */
938
- clientCredentials?: OAuthFlowObject;
939
-
940
- /**
941
- * Configuration for the OAuth Authorization Code flow (previously called "accessCode" in OpenAPI 2.0).
942
- */
943
- authorizationCode?: OAuthFlowObject;
944
- }