@hey-api/openapi-ts 0.54.2 → 0.54.3
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/dist/index.cjs +63 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1374 -102
- package/dist/index.d.ts +1374 -102
- package/dist/index.js +59 -55
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ interface OpenApiSchemaExtensions {
|
|
|
40
40
|
/**
|
|
41
41
|
* Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#composition-and-inheritance-polymorphism Composition and Inheritance} for more details.
|
|
42
42
|
*/
|
|
43
|
-
discriminator?: DiscriminatorObject;
|
|
43
|
+
discriminator?: DiscriminatorObject$1;
|
|
44
44
|
/**
|
|
45
45
|
* A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
|
|
46
46
|
*
|
|
@@ -50,11 +50,11 @@ interface OpenApiSchemaExtensions {
|
|
|
50
50
|
/**
|
|
51
51
|
* Additional external documentation for this schema.
|
|
52
52
|
*/
|
|
53
|
-
externalDocs?: ExternalDocumentationObject;
|
|
53
|
+
externalDocs?: ExternalDocumentationObject$1;
|
|
54
54
|
/**
|
|
55
55
|
* This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
|
|
56
56
|
*/
|
|
57
|
-
xml?: XMLObject;
|
|
57
|
+
xml?: XMLObject$1;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// TODO: left out some keywords related to structuring a complex schema and declaring a dialect
|
|
@@ -154,7 +154,7 @@ interface JsonSchemaDraft2020_12
|
|
|
154
154
|
*
|
|
155
155
|
* There is a bias toward networking-related formats in the JSON Schema specification, most likely due to its heritage in web technologies. However, custom formats may also be used, as long as the parties exchanging the JSON documents also exchange information about the custom format types. A JSON Schema validator will ignore any format type that it does not understand.
|
|
156
156
|
*/
|
|
157
|
-
format?: JsonSchemaFormats;
|
|
157
|
+
format?: JsonSchemaFormats$1;
|
|
158
158
|
/**
|
|
159
159
|
* The `if`, `then` and `else` keywords allow the application of a subschema based on the outcome of another schema, much like the `if`/`then`/`else` constructs you've probably seen in traditional programming languages.
|
|
160
160
|
*
|
|
@@ -387,7 +387,7 @@ interface StringKeywords {
|
|
|
387
387
|
pattern?: string;
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
type JsonSchemaFormats =
|
|
390
|
+
type JsonSchemaFormats$1 =
|
|
391
391
|
| 'date'
|
|
392
392
|
| 'date-time'
|
|
393
393
|
| 'duration'
|
|
@@ -424,7 +424,7 @@ type JsonSchemaTypes =
|
|
|
424
424
|
*
|
|
425
425
|
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
|
|
426
426
|
*/
|
|
427
|
-
interface
|
|
427
|
+
interface OpenApiV3_1_X {
|
|
428
428
|
/**
|
|
429
429
|
* An element to hold various schemas for the document.
|
|
430
430
|
*/
|
|
@@ -432,11 +432,11 @@ interface OpenApiV3_1_0 {
|
|
|
432
432
|
/**
|
|
433
433
|
* Additional external documentation.
|
|
434
434
|
*/
|
|
435
|
-
externalDocs?: ExternalDocumentationObject;
|
|
435
|
+
externalDocs?: ExternalDocumentationObject$1;
|
|
436
436
|
/**
|
|
437
437
|
* **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
|
|
438
438
|
*/
|
|
439
|
-
info: InfoObject;
|
|
439
|
+
info: InfoObject$1;
|
|
440
440
|
/**
|
|
441
441
|
* The default value for the `$schema` keyword within {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object Schema Objects} contained within this OAS document. This MUST be in the form of a URI.
|
|
442
442
|
*/
|
|
@@ -448,23 +448,23 @@ interface OpenApiV3_1_0 {
|
|
|
448
448
|
/**
|
|
449
449
|
* The available paths and operations for the API.
|
|
450
450
|
*/
|
|
451
|
-
paths?: PathsObject;
|
|
451
|
+
paths?: PathsObject$1;
|
|
452
452
|
/**
|
|
453
453
|
* A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement (`{}`) can be included in the array.
|
|
454
454
|
*/
|
|
455
|
-
security?: ReadonlyArray<SecurityRequirementObject>;
|
|
455
|
+
security?: ReadonlyArray<SecurityRequirementObject$1>;
|
|
456
456
|
/**
|
|
457
457
|
* An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-object Server Object} with a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverUrl url} value of `/`.
|
|
458
458
|
*/
|
|
459
|
-
servers?: ReadonlyArray<ServerObject>;
|
|
459
|
+
servers?: ReadonlyArray<ServerObject$1>;
|
|
460
460
|
/**
|
|
461
461
|
* A list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object Operation Object} must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
|
|
462
462
|
*/
|
|
463
|
-
tags?: ReadonlyArray<TagObject>;
|
|
463
|
+
tags?: ReadonlyArray<TagObject$1>;
|
|
464
464
|
/**
|
|
465
465
|
* The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the `callbacks` feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An {@link https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.1/webhook-example.yaml example} is available.
|
|
466
466
|
*/
|
|
467
|
-
webhooks?: Record<string, PathItemObject | ReferenceObject>;
|
|
467
|
+
webhooks?: Record<string, PathItemObject$1 | ReferenceObject$1>;
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
/**
|
|
@@ -548,11 +548,11 @@ interface OpenApiV3_1_0 {
|
|
|
548
548
|
* description: callback successfully processed
|
|
549
549
|
* ```
|
|
550
550
|
*/
|
|
551
|
-
interface CallbackObject {
|
|
551
|
+
interface CallbackObject$1 {
|
|
552
552
|
/**
|
|
553
553
|
* A Path Item Object, or a reference to one, used to define a callback request and expected responses. A {@link https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/callback-example.yaml complete example} is available.
|
|
554
554
|
*/
|
|
555
|
-
[expression: string]: PathItemObject | ReferenceObject;
|
|
555
|
+
[expression: string]: PathItemObject$1 | ReferenceObject$1;
|
|
556
556
|
}
|
|
557
557
|
|
|
558
558
|
/**
|
|
@@ -648,43 +648,43 @@ interface ComponentsObject$1 {
|
|
|
648
648
|
/**
|
|
649
649
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object Callback Objects}.
|
|
650
650
|
*/
|
|
651
|
-
callbacks?: Record<string, CallbackObject | ReferenceObject>;
|
|
651
|
+
callbacks?: Record<string, CallbackObject$1 | ReferenceObject$1>;
|
|
652
652
|
/**
|
|
653
653
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#example-object Example Objects}.
|
|
654
654
|
*/
|
|
655
|
-
examples?: Record<string, ExampleObject | ReferenceObject>;
|
|
655
|
+
examples?: Record<string, ExampleObject$1 | ReferenceObject$1>;
|
|
656
656
|
/**
|
|
657
657
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#header-object Header Objects}.
|
|
658
658
|
*/
|
|
659
|
-
headers?: Record<string, HeaderObject | ReferenceObject>;
|
|
659
|
+
headers?: Record<string, HeaderObject$1 | ReferenceObject$1>;
|
|
660
660
|
/**
|
|
661
661
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#link-object Link Objects}.
|
|
662
662
|
*/
|
|
663
|
-
links?: Record<string, LinkObject | ReferenceObject>;
|
|
663
|
+
links?: Record<string, LinkObject$1 | ReferenceObject$1>;
|
|
664
664
|
/**
|
|
665
665
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object Parameter Objects}.
|
|
666
666
|
*/
|
|
667
|
-
parameters?: Record<string, ParameterObject | ReferenceObject>;
|
|
667
|
+
parameters?: Record<string, ParameterObject$1 | ReferenceObject$1>;
|
|
668
668
|
/**
|
|
669
669
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object Path Item Object}.
|
|
670
670
|
*/
|
|
671
|
-
pathItems?: Record<string, PathItemObject | ReferenceObject>;
|
|
671
|
+
pathItems?: Record<string, PathItemObject$1 | ReferenceObject$1>;
|
|
672
672
|
/**
|
|
673
673
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#request-body-object Request Body Objects}.
|
|
674
674
|
*/
|
|
675
|
-
requestBodies?: Record<string, RequestBodyObject | ReferenceObject>;
|
|
675
|
+
requestBodies?: Record<string, RequestBodyObject$1 | ReferenceObject$1>;
|
|
676
676
|
/**
|
|
677
677
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#response-object Response Objects}.
|
|
678
678
|
*/
|
|
679
|
-
responses?: Record<string, ResponseObject | ReferenceObject>;
|
|
679
|
+
responses?: Record<string, ResponseObject$1 | ReferenceObject$1>;
|
|
680
680
|
/**
|
|
681
681
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object Schema Objects}.
|
|
682
682
|
*/
|
|
683
|
-
schemas?: Record<string, SchemaObject>;
|
|
683
|
+
schemas?: Record<string, SchemaObject$1>;
|
|
684
684
|
/**
|
|
685
685
|
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-scheme-object Security Scheme Objects}.
|
|
686
686
|
*/
|
|
687
|
-
securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
|
|
687
|
+
securitySchemes?: Record<string, SecuritySchemeObject$1 | ReferenceObject$1>;
|
|
688
688
|
}
|
|
689
689
|
|
|
690
690
|
/**
|
|
@@ -699,7 +699,7 @@ interface ComponentsObject$1 {
|
|
|
699
699
|
* email: support@example.com
|
|
700
700
|
* ```
|
|
701
701
|
*/
|
|
702
|
-
interface ContactObject {
|
|
702
|
+
interface ContactObject$1 {
|
|
703
703
|
/**
|
|
704
704
|
* The email address of the contact person/organization. This MUST be in the form of an email address.
|
|
705
705
|
*/
|
|
@@ -840,7 +840,7 @@ interface ContactObject {
|
|
|
840
840
|
*
|
|
841
841
|
* will map to `Dog` because of the definition in the `mapping` element.
|
|
842
842
|
*/
|
|
843
|
-
interface DiscriminatorObject {
|
|
843
|
+
interface DiscriminatorObject$1 {
|
|
844
844
|
/**
|
|
845
845
|
* An object to hold mappings between payload values and schema names or references.
|
|
846
846
|
*/
|
|
@@ -892,7 +892,7 @@ interface DiscriminatorObject {
|
|
|
892
892
|
* type: integer
|
|
893
893
|
* ```
|
|
894
894
|
*/
|
|
895
|
-
interface EncodingObject {
|
|
895
|
+
interface EncodingObject$1 {
|
|
896
896
|
/**
|
|
897
897
|
* Determines whether the parameter value SHOULD allow reserved characters, as defined by {@link https://tools.ietf.org/html/rfc3986#section-2.2 RFC3986} `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#encodingContentType `contentType`} (implicit or explicit) SHALL be ignored.
|
|
898
898
|
*/
|
|
@@ -908,11 +908,18 @@ interface EncodingObject {
|
|
|
908
908
|
/**
|
|
909
909
|
* A map allowing additional information to be provided as headers, for example `Content-Disposition`. `Content-Type` is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a `multipart`.
|
|
910
910
|
*/
|
|
911
|
-
headers?: Record<string, HeaderObject | ReferenceObject>;
|
|
911
|
+
headers?: Record<string, HeaderObject$1 | ReferenceObject$1>;
|
|
912
912
|
/**
|
|
913
913
|
* Describes how a specific property value will be serialized depending on its type. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object Parameter Object} for details on the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterStyle `style`} property. The behavior follows the same values as `query` parameters, including default values. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#encodingContentType `contentType`} (implicit or explicit) SHALL be ignored.
|
|
914
914
|
*/
|
|
915
|
-
style?:
|
|
915
|
+
style?:
|
|
916
|
+
| 'deepObject'
|
|
917
|
+
| 'form'
|
|
918
|
+
| 'label'
|
|
919
|
+
| 'matrix'
|
|
920
|
+
| 'pipeDelimited'
|
|
921
|
+
| 'simple'
|
|
922
|
+
| 'spaceDelimited';
|
|
916
923
|
}
|
|
917
924
|
|
|
918
925
|
/**
|
|
@@ -981,7 +988,7 @@ interface EncodingObject {
|
|
|
981
988
|
* $ref: '#/components/examples/confirmation-success'
|
|
982
989
|
* ```
|
|
983
990
|
*/
|
|
984
|
-
interface ExampleObject {
|
|
991
|
+
interface ExampleObject$1 {
|
|
985
992
|
/**
|
|
986
993
|
* Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
987
994
|
*/
|
|
@@ -1011,7 +1018,7 @@ interface ExampleObject {
|
|
|
1011
1018
|
* url: https://example.com
|
|
1012
1019
|
* ```
|
|
1013
1020
|
*/
|
|
1014
|
-
interface ExternalDocumentationObject {
|
|
1021
|
+
interface ExternalDocumentationObject$1 {
|
|
1015
1022
|
/**
|
|
1016
1023
|
* A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
1017
1024
|
*/
|
|
@@ -1036,7 +1043,7 @@ interface ExternalDocumentationObject {
|
|
|
1036
1043
|
* type: integer
|
|
1037
1044
|
* ```
|
|
1038
1045
|
*/
|
|
1039
|
-
interface HeaderObject extends Omit<ParameterObject, 'in' | 'name'> {}
|
|
1046
|
+
interface HeaderObject$1 extends Omit<ParameterObject$1, 'in' | 'name'> {}
|
|
1040
1047
|
|
|
1041
1048
|
/**
|
|
1042
1049
|
* The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
|
|
@@ -1059,11 +1066,11 @@ interface HeaderObject extends Omit<ParameterObject, 'in' | 'name'> {}
|
|
|
1059
1066
|
* version: 1.0.1
|
|
1060
1067
|
* ```
|
|
1061
1068
|
*/
|
|
1062
|
-
interface InfoObject {
|
|
1069
|
+
interface InfoObject$1 {
|
|
1063
1070
|
/**
|
|
1064
1071
|
* The contact information for the exposed API.
|
|
1065
1072
|
*/
|
|
1066
|
-
contact?: ContactObject;
|
|
1073
|
+
contact?: ContactObject$1;
|
|
1067
1074
|
/**
|
|
1068
1075
|
* A description of the API. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
1069
1076
|
*/
|
|
@@ -1071,7 +1078,7 @@ interface InfoObject {
|
|
|
1071
1078
|
/**
|
|
1072
1079
|
* The license information for the exposed API.
|
|
1073
1080
|
*/
|
|
1074
|
-
license?: LicenseObject;
|
|
1081
|
+
license?: LicenseObject$1;
|
|
1075
1082
|
/**
|
|
1076
1083
|
* A short summary of the API.
|
|
1077
1084
|
*/
|
|
@@ -1101,7 +1108,7 @@ interface InfoObject {
|
|
|
1101
1108
|
* identifier: Apache-2.0
|
|
1102
1109
|
* ```
|
|
1103
1110
|
*/
|
|
1104
|
-
interface LicenseObject {
|
|
1111
|
+
interface LicenseObject$1 {
|
|
1105
1112
|
/**
|
|
1106
1113
|
* An {@link https://spdx.org/licenses/ SPDX} license expression for the API. The `identifier` field is mutually exclusive of the `url` field.
|
|
1107
1114
|
*/
|
|
@@ -1263,7 +1270,7 @@ interface LicenseObject {
|
|
|
1263
1270
|
*
|
|
1264
1271
|
* Runtime expressions preserve the type of the referenced value. Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
|
|
1265
1272
|
*/
|
|
1266
|
-
interface LinkObject {
|
|
1273
|
+
interface LinkObject$1 {
|
|
1267
1274
|
/**
|
|
1268
1275
|
* A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
1269
1276
|
*/
|
|
@@ -1287,7 +1294,7 @@ interface LinkObject {
|
|
|
1287
1294
|
/**
|
|
1288
1295
|
* A server object to be used by the target operation.
|
|
1289
1296
|
*/
|
|
1290
|
-
server?: ServerObject;
|
|
1297
|
+
server?: ServerObject$1;
|
|
1291
1298
|
}
|
|
1292
1299
|
|
|
1293
1300
|
/**
|
|
@@ -1323,11 +1330,11 @@ interface LinkObject {
|
|
|
1323
1330
|
* $ref: "#/components/examples/frog-example"
|
|
1324
1331
|
* ```
|
|
1325
1332
|
*/
|
|
1326
|
-
interface MediaTypeObject$
|
|
1333
|
+
interface MediaTypeObject$2 {
|
|
1327
1334
|
/**
|
|
1328
1335
|
* A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`.
|
|
1329
1336
|
*/
|
|
1330
|
-
encoding?: Record<string, EncodingObject>;
|
|
1337
|
+
encoding?: Record<string, EncodingObject$1>;
|
|
1331
1338
|
/**
|
|
1332
1339
|
* Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema.
|
|
1333
1340
|
*/
|
|
@@ -1335,11 +1342,11 @@ interface MediaTypeObject$1 {
|
|
|
1335
1342
|
/**
|
|
1336
1343
|
* Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
|
|
1337
1344
|
*/
|
|
1338
|
-
examples?: Record<string, ExampleObject | ReferenceObject>;
|
|
1345
|
+
examples?: Record<string, ExampleObject$1 | ReferenceObject$1>;
|
|
1339
1346
|
/**
|
|
1340
1347
|
* The schema defining the content of the request, response, or parameter.
|
|
1341
1348
|
*/
|
|
1342
|
-
schema?: SchemaObject;
|
|
1349
|
+
schema?: SchemaObject$1;
|
|
1343
1350
|
}
|
|
1344
1351
|
|
|
1345
1352
|
/**
|
|
@@ -1365,7 +1372,7 @@ interface MediaTypeObject$1 {
|
|
|
1365
1372
|
* read:pets: read your pets
|
|
1366
1373
|
* ```
|
|
1367
1374
|
*/
|
|
1368
|
-
interface OAuthFlowObject {
|
|
1375
|
+
interface OAuthFlowObject$1 {
|
|
1369
1376
|
/**
|
|
1370
1377
|
* **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
|
|
1371
1378
|
*/
|
|
@@ -1389,23 +1396,23 @@ interface OAuthFlowObject {
|
|
|
1389
1396
|
*
|
|
1390
1397
|
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
|
|
1391
1398
|
*/
|
|
1392
|
-
interface OAuthFlowsObject {
|
|
1399
|
+
interface OAuthFlowsObject$1 {
|
|
1393
1400
|
/**
|
|
1394
1401
|
* Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
|
|
1395
1402
|
*/
|
|
1396
|
-
authorizationCode?: OAuthFlowObject;
|
|
1403
|
+
authorizationCode?: OAuthFlowObject$1;
|
|
1397
1404
|
/**
|
|
1398
1405
|
* Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
|
|
1399
1406
|
*/
|
|
1400
|
-
clientCredentials?: OAuthFlowObject;
|
|
1407
|
+
clientCredentials?: OAuthFlowObject$1;
|
|
1401
1408
|
/**
|
|
1402
1409
|
* Configuration for the OAuth Implicit flow
|
|
1403
1410
|
*/
|
|
1404
|
-
implicit?: OAuthFlowObject;
|
|
1411
|
+
implicit?: OAuthFlowObject$1;
|
|
1405
1412
|
/**
|
|
1406
1413
|
* Configuration for the OAuth Resource Owner Password flow
|
|
1407
1414
|
*/
|
|
1408
|
-
password?: OAuthFlowObject;
|
|
1415
|
+
password?: OAuthFlowObject$1;
|
|
1409
1416
|
}
|
|
1410
1417
|
|
|
1411
1418
|
/**
|
|
@@ -1457,11 +1464,11 @@ interface OAuthFlowsObject {
|
|
|
1457
1464
|
* - read:pets
|
|
1458
1465
|
* ```
|
|
1459
1466
|
*/
|
|
1460
|
-
interface OperationObject {
|
|
1467
|
+
interface OperationObject$1 {
|
|
1461
1468
|
/**
|
|
1462
1469
|
* A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object Callback Object} that describes a request that may be initiated by the API provider and the expected responses.
|
|
1463
1470
|
*/
|
|
1464
|
-
callbacks?: Record<string, CallbackObject | ReferenceObject>;
|
|
1471
|
+
callbacks?: Record<string, CallbackObject$1 | ReferenceObject$1>;
|
|
1465
1472
|
/**
|
|
1466
1473
|
* Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
|
|
1467
1474
|
*/
|
|
@@ -1473,7 +1480,7 @@ interface OperationObject {
|
|
|
1473
1480
|
/**
|
|
1474
1481
|
* Additional external documentation for this operation.
|
|
1475
1482
|
*/
|
|
1476
|
-
externalDocs?: ExternalDocumentationObject;
|
|
1483
|
+
externalDocs?: ExternalDocumentationObject$1;
|
|
1477
1484
|
/**
|
|
1478
1485
|
* Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
|
|
1479
1486
|
*/
|
|
@@ -1481,23 +1488,23 @@ interface OperationObject {
|
|
|
1481
1488
|
/**
|
|
1482
1489
|
* A list of parameters that are applicable for this operation. If a parameter is already defined at the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemParameters Path Item}, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterName name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterIn location}. The list can use the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#reference-object Reference Object} to link to parameters that are defined at the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsParameters OpenAPI Object's components/parameters}.
|
|
1483
1490
|
*/
|
|
1484
|
-
parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
|
|
1491
|
+
parameters?: ReadonlyArray<ParameterObject$1 | ReferenceObject$1>;
|
|
1485
1492
|
/**
|
|
1486
1493
|
* The request body applicable for this operation. The `requestBody` is fully supported in HTTP methods where the HTTP 1.1 specification {@link https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.1 RFC7231} has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as {@link https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.1 GET}, {@link https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.2 HEAD} and {@link https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.5 DELETE}), `requestBody` is permitted but does not have well-defined semantics and SHOULD be avoided if possible.
|
|
1487
1494
|
*/
|
|
1488
|
-
requestBody?: RequestBodyObject | ReferenceObject;
|
|
1495
|
+
requestBody?: RequestBodyObject$1 | ReferenceObject$1;
|
|
1489
1496
|
/**
|
|
1490
1497
|
* The list of possible responses as they are returned from executing this operation.
|
|
1491
1498
|
*/
|
|
1492
|
-
responses?: ResponsesObject;
|
|
1499
|
+
responses?: ResponsesObject$1;
|
|
1493
1500
|
/**
|
|
1494
1501
|
* A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. To make security optional, an empty security requirement (`{}`) can be included in the array. This definition overrides any declared top-level {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oasSecurity `security`}. To remove a top-level security declaration, an empty array can be used.
|
|
1495
1502
|
*/
|
|
1496
|
-
security?: ReadonlyArray<SecurityRequirementObject>;
|
|
1503
|
+
security?: ReadonlyArray<SecurityRequirementObject$1>;
|
|
1497
1504
|
/**
|
|
1498
1505
|
* An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
|
|
1499
1506
|
*/
|
|
1500
|
-
servers?: ReadonlyArray<ServerObject>;
|
|
1507
|
+
servers?: ReadonlyArray<ServerObject$1>;
|
|
1501
1508
|
/**
|
|
1502
1509
|
* A short summary of what the operation does.
|
|
1503
1510
|
*/
|
|
@@ -1605,7 +1612,7 @@ interface OperationObject {
|
|
|
1605
1612
|
* type: number
|
|
1606
1613
|
* ```
|
|
1607
1614
|
*/
|
|
1608
|
-
interface ParameterObject {
|
|
1615
|
+
interface ParameterObject$1 {
|
|
1609
1616
|
/**
|
|
1610
1617
|
* Sets the ability to pass empty-valued parameters. This is valid only for `query` parameters and allows sending a parameter with an empty value. Default value is `false`. If {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterStyle `style`} is used, and if behavior is `n/a` (cannot be serialized), the value of `allowEmptyValue` SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision.
|
|
1611
1618
|
*/
|
|
@@ -1617,7 +1624,7 @@ interface ParameterObject {
|
|
|
1617
1624
|
/**
|
|
1618
1625
|
* A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
|
|
1619
1626
|
*/
|
|
1620
|
-
content?: Record<string, MediaTypeObject$
|
|
1627
|
+
content?: Record<string, MediaTypeObject$2>;
|
|
1621
1628
|
/**
|
|
1622
1629
|
* Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
|
|
1623
1630
|
*/
|
|
@@ -1633,7 +1640,7 @@ interface ParameterObject {
|
|
|
1633
1640
|
/**
|
|
1634
1641
|
* Examples of the parameter's potential value. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` that contains an example, the `examples` value SHALL _override_ the example provided by the schema.
|
|
1635
1642
|
*/
|
|
1636
|
-
examples?: Record<string, ExampleObject | ReferenceObject>;
|
|
1643
|
+
examples?: Record<string, ExampleObject$1 | ReferenceObject$1>;
|
|
1637
1644
|
/**
|
|
1638
1645
|
* 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. For other types of parameters this property has no effect. When {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterStyle `style`} is `form`, the default value is `true`. For all other styles, the default value is `false`.
|
|
1639
1646
|
*/
|
|
@@ -1656,7 +1663,7 @@ interface ParameterObject {
|
|
|
1656
1663
|
/**
|
|
1657
1664
|
* The schema defining the type used for the parameter.
|
|
1658
1665
|
*/
|
|
1659
|
-
schema?: SchemaObject;
|
|
1666
|
+
schema?: SchemaObject$1;
|
|
1660
1667
|
/**
|
|
1661
1668
|
* Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
|
|
1662
1669
|
*/
|
|
@@ -1708,7 +1715,7 @@ interface ParameterObject {
|
|
|
1708
1715
|
* style: simple
|
|
1709
1716
|
* ```
|
|
1710
1717
|
*/
|
|
1711
|
-
interface PathItemObject {
|
|
1718
|
+
interface PathItemObject$1 {
|
|
1712
1719
|
/**
|
|
1713
1720
|
* Allows for a referenced definition of this path item. The referenced structure MUST be in the form of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object Path Item Object}. In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#relative-references-in-uris Relative References}.
|
|
1714
1721
|
*/
|
|
@@ -1716,7 +1723,7 @@ interface PathItemObject {
|
|
|
1716
1723
|
/**
|
|
1717
1724
|
* A definition of a DELETE operation on this path.
|
|
1718
1725
|
*/
|
|
1719
|
-
delete?: OperationObject;
|
|
1726
|
+
delete?: OperationObject$1;
|
|
1720
1727
|
/**
|
|
1721
1728
|
* An optional, string description, intended to apply to all operations in this path. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
1722
1729
|
*/
|
|
@@ -1724,35 +1731,35 @@ interface PathItemObject {
|
|
|
1724
1731
|
/**
|
|
1725
1732
|
* A definition of a GET operation on this path.
|
|
1726
1733
|
*/
|
|
1727
|
-
get?: OperationObject;
|
|
1734
|
+
get?: OperationObject$1;
|
|
1728
1735
|
/**
|
|
1729
1736
|
* A definition of a HEAD operation on this path.
|
|
1730
1737
|
*/
|
|
1731
|
-
head?: OperationObject;
|
|
1738
|
+
head?: OperationObject$1;
|
|
1732
1739
|
/**
|
|
1733
1740
|
* A definition of a OPTIONS operation on this path.
|
|
1734
1741
|
*/
|
|
1735
|
-
options?: OperationObject;
|
|
1742
|
+
options?: OperationObject$1;
|
|
1736
1743
|
/**
|
|
1737
1744
|
* A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterName name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterIn location}. The list can use the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#reference-object Reference Object} to link to parameters that are defined at the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsParameters OpenAPI Object's components/parameters}.
|
|
1738
1745
|
*/
|
|
1739
|
-
parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
|
|
1746
|
+
parameters?: ReadonlyArray<ParameterObject$1 | ReferenceObject$1>;
|
|
1740
1747
|
/**
|
|
1741
1748
|
* A definition of a PATCH operation on this path.
|
|
1742
1749
|
*/
|
|
1743
|
-
patch?: OperationObject;
|
|
1750
|
+
patch?: OperationObject$1;
|
|
1744
1751
|
/**
|
|
1745
1752
|
* A definition of a POST operation on this path.
|
|
1746
1753
|
*/
|
|
1747
|
-
post?: OperationObject;
|
|
1754
|
+
post?: OperationObject$1;
|
|
1748
1755
|
/**
|
|
1749
1756
|
* A definition of a PUT operation on this path.
|
|
1750
1757
|
*/
|
|
1751
|
-
put?: OperationObject;
|
|
1758
|
+
put?: OperationObject$1;
|
|
1752
1759
|
/**
|
|
1753
1760
|
* An alternative `server` array to service all operations in this path.
|
|
1754
1761
|
*/
|
|
1755
|
-
servers?: ReadonlyArray<ServerObject>;
|
|
1762
|
+
servers?: ReadonlyArray<ServerObject$1>;
|
|
1756
1763
|
/**
|
|
1757
1764
|
* An optional, string summary, intended to apply to all operations in this path.
|
|
1758
1765
|
*/
|
|
@@ -1760,7 +1767,7 @@ interface PathItemObject {
|
|
|
1760
1767
|
/**
|
|
1761
1768
|
* A definition of a TRACE operation on this path.
|
|
1762
1769
|
*/
|
|
1763
|
-
trace?: OperationObject;
|
|
1770
|
+
trace?: OperationObject$1;
|
|
1764
1771
|
}
|
|
1765
1772
|
|
|
1766
1773
|
/**
|
|
@@ -1808,11 +1815,11 @@ interface PathItemObject {
|
|
|
1808
1815
|
* $ref: '#/components/schemas/pet'
|
|
1809
1816
|
* ```
|
|
1810
1817
|
*/
|
|
1811
|
-
interface PathsObject {
|
|
1818
|
+
interface PathsObject$1 {
|
|
1812
1819
|
/**
|
|
1813
1820
|
* A relative path to an individual endpoint. The field name MUST begin with a forward slash (`/`). The path is **appended** (no relative URL resolution) to the expanded URL from the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-object `Server Object`}'s `url` field in order to construct the full URL. {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-templating Path templating} is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
|
|
1814
1821
|
*/
|
|
1815
|
-
[path: `/${string}`]: PathItemObject;
|
|
1822
|
+
[path: `/${string}`]: PathItemObject$1;
|
|
1816
1823
|
}
|
|
1817
1824
|
|
|
1818
1825
|
/**
|
|
@@ -1847,7 +1854,7 @@ interface PathsObject {
|
|
|
1847
1854
|
* $ref: definitions.yaml#/Pet
|
|
1848
1855
|
* ```
|
|
1849
1856
|
*/
|
|
1850
|
-
interface ReferenceObject {
|
|
1857
|
+
interface ReferenceObject$1 {
|
|
1851
1858
|
/**
|
|
1852
1859
|
* **REQUIRED**. The reference identifier. This MUST be in the form of a URI.
|
|
1853
1860
|
*/
|
|
@@ -1913,11 +1920,11 @@ interface ReferenceObject {
|
|
|
1913
1920
|
* type: string
|
|
1914
1921
|
* ```
|
|
1915
1922
|
*/
|
|
1916
|
-
interface RequestBodyObject {
|
|
1923
|
+
interface RequestBodyObject$1 {
|
|
1917
1924
|
/**
|
|
1918
1925
|
* **REQUIRED**. The content of the request body. The key is a media type or {@link https://tools.ietf.org/html/rfc7231#appendix-D media type range} and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
|
|
1919
1926
|
*/
|
|
1920
|
-
content: Record<string, MediaTypeObject$
|
|
1927
|
+
content: Record<string, MediaTypeObject$2>;
|
|
1921
1928
|
/**
|
|
1922
1929
|
* A brief description of the request body. This could contain examples of use. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
1923
1930
|
*/
|
|
@@ -1989,11 +1996,11 @@ interface RequestBodyObject {
|
|
|
1989
1996
|
* description: object created
|
|
1990
1997
|
* ```
|
|
1991
1998
|
*/
|
|
1992
|
-
interface ResponseObject {
|
|
1999
|
+
interface ResponseObject$1 {
|
|
1993
2000
|
/**
|
|
1994
2001
|
* A map containing descriptions of potential response payloads. The key is a media type or {@link https://datatracker.ietf.org/doc/html/rfc7231#appendix-D media type range} and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
|
|
1995
2002
|
*/
|
|
1996
|
-
content?: Record<string, MediaTypeObject$
|
|
2003
|
+
content?: Record<string, MediaTypeObject$2>;
|
|
1997
2004
|
/**
|
|
1998
2005
|
* **REQUIRED**. A description of the response. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
1999
2006
|
*/
|
|
@@ -2001,11 +2008,11 @@ interface ResponseObject {
|
|
|
2001
2008
|
/**
|
|
2002
2009
|
* Maps a header name to its definition. {@link https://datatracker.ietf.org/doc/html/rfc7230#page-22 RFC7230} states header names are case insensitive. If a response header is defined with the name `"Content-Type"`, it SHALL be ignored.
|
|
2003
2010
|
*/
|
|
2004
|
-
headers?: Record<string, HeaderObject | ReferenceObject>;
|
|
2011
|
+
headers?: Record<string, HeaderObject$1 | ReferenceObject$1>;
|
|
2005
2012
|
/**
|
|
2006
2013
|
* A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object Component Objects}.
|
|
2007
2014
|
*/
|
|
2008
|
-
links?: Record<string, LinkObject | ReferenceObject>;
|
|
2015
|
+
links?: Record<string, LinkObject$1 | ReferenceObject$1>;
|
|
2009
2016
|
}
|
|
2010
2017
|
|
|
2011
2018
|
/**
|
|
@@ -2037,15 +2044,15 @@ interface ResponseObject {
|
|
|
2037
2044
|
* $ref: '#/components/schemas/ErrorModel'
|
|
2038
2045
|
* ```
|
|
2039
2046
|
*/
|
|
2040
|
-
interface ResponsesObject {
|
|
2047
|
+
interface ResponsesObject$1 {
|
|
2041
2048
|
/**
|
|
2042
2049
|
* Any {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#http-status-codes HTTP status code} can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `[200-299]`. Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
|
|
2043
2050
|
*/
|
|
2044
|
-
[
|
|
2051
|
+
[httpStatusCode: string]: ResponseObject$1 | ReferenceObject$1 | undefined;
|
|
2045
2052
|
/**
|
|
2046
2053
|
* The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses.
|
|
2047
2054
|
*/
|
|
2048
|
-
default?: ResponseObject | ReferenceObject;
|
|
2055
|
+
default?: ResponseObject$1 | ReferenceObject$1;
|
|
2049
2056
|
}
|
|
2050
2057
|
|
|
2051
2058
|
/**
|
|
@@ -2072,7 +2079,7 @@ interface ResponsesObject {
|
|
|
2072
2079
|
*
|
|
2073
2080
|
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}, though as noted, additional properties MAY omit the `x-` prefix within this object.
|
|
2074
2081
|
*/
|
|
2075
|
-
interface SchemaObject extends JsonSchemaDraft2020_12 {}
|
|
2082
|
+
interface SchemaObject$1 extends JsonSchemaDraft2020_12 {}
|
|
2076
2083
|
|
|
2077
2084
|
/**
|
|
2078
2085
|
* Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsSecuritySchemes Security Schemes} under the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object Components Object}.
|
|
@@ -2108,7 +2115,7 @@ interface SchemaObject extends JsonSchemaDraft2020_12 {}
|
|
|
2108
2115
|
* - read:pets
|
|
2109
2116
|
* ```
|
|
2110
2117
|
*/
|
|
2111
|
-
interface SecurityRequirementObject {
|
|
2118
|
+
interface SecurityRequirementObject$1 {
|
|
2112
2119
|
/**
|
|
2113
2120
|
* Each name MUST correspond to a security scheme which is declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsSecuritySchemes Security Schemes} under the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object Components Object}. If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MAY contain a list of role names which are required for the execution, but are not otherwise defined or exchanged in-band.
|
|
2114
2121
|
*/
|
|
@@ -2159,7 +2166,7 @@ interface SecurityRequirementObject {
|
|
|
2159
2166
|
* read:pets: read your pets
|
|
2160
2167
|
* ```
|
|
2161
2168
|
*/
|
|
2162
|
-
type SecuritySchemeObject = {
|
|
2169
|
+
type SecuritySchemeObject$1 = {
|
|
2163
2170
|
/**
|
|
2164
2171
|
* A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
2165
2172
|
*/
|
|
@@ -2203,7 +2210,7 @@ type SecuritySchemeObject = {
|
|
|
2203
2210
|
/**
|
|
2204
2211
|
* **REQUIRED**. An object containing configuration information for the flow types supported.
|
|
2205
2212
|
*/
|
|
2206
|
-
flows: OAuthFlowsObject;
|
|
2213
|
+
flows: OAuthFlowsObject$1;
|
|
2207
2214
|
/**
|
|
2208
2215
|
* **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`.
|
|
2209
2216
|
*/
|
|
@@ -2232,7 +2239,7 @@ type SecuritySchemeObject = {
|
|
|
2232
2239
|
* description: Development server
|
|
2233
2240
|
* ```
|
|
2234
2241
|
*/
|
|
2235
|
-
interface ServerObject {
|
|
2242
|
+
interface ServerObject$1 {
|
|
2236
2243
|
/**
|
|
2237
2244
|
* An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
2238
2245
|
*/
|
|
@@ -2244,7 +2251,7 @@ interface ServerObject {
|
|
|
2244
2251
|
/**
|
|
2245
2252
|
* A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
|
2246
2253
|
*/
|
|
2247
|
-
variables?: Record<string, ServerVariableObject>;
|
|
2254
|
+
variables?: Record<string, ServerVariableObject$1>;
|
|
2248
2255
|
}
|
|
2249
2256
|
|
|
2250
2257
|
/**
|
|
@@ -2252,7 +2259,7 @@ interface ServerObject {
|
|
|
2252
2259
|
*
|
|
2253
2260
|
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
|
|
2254
2261
|
*/
|
|
2255
|
-
interface ServerVariableObject {
|
|
2262
|
+
interface ServerVariableObject$1 {
|
|
2256
2263
|
/**
|
|
2257
2264
|
* **REQUIRED**. The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object Schema Object's} treatment of default values, because in those cases parameter values are optional. If the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverVariableEnum `enum`} is defined, the value MUST exist in the enum's values.
|
|
2258
2265
|
*/
|
|
@@ -2278,7 +2285,7 @@ interface ServerVariableObject {
|
|
|
2278
2285
|
* description: Pets operations
|
|
2279
2286
|
* ```
|
|
2280
2287
|
*/
|
|
2281
|
-
interface TagObject {
|
|
2288
|
+
interface TagObject$1 {
|
|
2282
2289
|
/**
|
|
2283
2290
|
* A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
2284
2291
|
*/
|
|
@@ -2286,7 +2293,7 @@ interface TagObject {
|
|
|
2286
2293
|
/**
|
|
2287
2294
|
* Additional external documentation for this tag.
|
|
2288
2295
|
*/
|
|
2289
|
-
externalDocs?: ExternalDocumentationObject;
|
|
2296
|
+
externalDocs?: ExternalDocumentationObject$1;
|
|
2290
2297
|
/**
|
|
2291
2298
|
* **REQUIRED**. The name of the tag.
|
|
2292
2299
|
*/
|
|
@@ -2485,7 +2492,7 @@ interface TagObject {
|
|
|
2485
2492
|
* </aliens>
|
|
2486
2493
|
* ```
|
|
2487
2494
|
*/
|
|
2488
|
-
interface XMLObject {
|
|
2495
|
+
interface XMLObject$1 {
|
|
2489
2496
|
/**
|
|
2490
2497
|
* Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
|
|
2491
2498
|
*/
|
|
@@ -2516,7 +2523,7 @@ interface Config$8 extends PluginName<'@hey-api/schemas'> {
|
|
|
2516
2523
|
*/
|
|
2517
2524
|
nameBuilder?: (
|
|
2518
2525
|
name: string,
|
|
2519
|
-
schema: OpenApiSchema | OpenApiSchema$1 | SchemaObject,
|
|
2526
|
+
schema: OpenApiSchema | OpenApiSchema$1 | SchemaObject$1,
|
|
2520
2527
|
) => string;
|
|
2521
2528
|
/**
|
|
2522
2529
|
* Name of the generated file.
|
|
@@ -3086,7 +3093,7 @@ type MediaType = 'application/json';
|
|
|
3086
3093
|
* to resolve the issue reported
|
|
3087
3094
|
* {@link https://github.com/hey-api/openapi-ts/issues/612}
|
|
3088
3095
|
*/
|
|
3089
|
-
interface MediaTypeObject {
|
|
3096
|
+
interface MediaTypeObject$1 {
|
|
3090
3097
|
example?: unknown;
|
|
3091
3098
|
examples?: Dictionary<OpenApiExample>;
|
|
3092
3099
|
schema: OpenApiSchema$1;
|
|
@@ -3097,7 +3104,7 @@ interface MediaTypeObject {
|
|
|
3097
3104
|
interface OpenApiParameter extends OpenApiReference$1 {
|
|
3098
3105
|
allowEmptyValue?: boolean;
|
|
3099
3106
|
allowReserved?: boolean;
|
|
3100
|
-
content?: Record<MediaType, MediaTypeObject>;
|
|
3107
|
+
content?: Record<MediaType, MediaTypeObject$1>;
|
|
3101
3108
|
deprecated?: boolean;
|
|
3102
3109
|
description?: string;
|
|
3103
3110
|
example?: unknown;
|
|
@@ -3306,20 +3313,1285 @@ interface Client extends Omit<Client$1, 'operations'> {
|
|
|
3306
3313
|
*
|
|
3307
3314
|
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3308
3315
|
*/
|
|
3309
|
-
interface
|
|
3316
|
+
interface OpenApiV3_0_X {
|
|
3310
3317
|
/**
|
|
3311
3318
|
* An element to hold various Objects for the OpenAPI Description.
|
|
3312
3319
|
*/
|
|
3313
3320
|
components?: ComponentsObject;
|
|
3321
|
+
/**
|
|
3322
|
+
* Additional external documentation.
|
|
3323
|
+
*/
|
|
3324
|
+
externalDocs?: ExternalDocumentationObject;
|
|
3325
|
+
/**
|
|
3326
|
+
* **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
|
|
3327
|
+
*/
|
|
3328
|
+
info: InfoObject;
|
|
3314
3329
|
/**
|
|
3315
3330
|
* **REQUIRED**. This string MUST be the {@link https://semver.org/spec/v2.0.0.html semantic version number} of the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#versions OpenAPI Specification version} that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is _not_ related to the API {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#infoVersion `info.version`} string.
|
|
3316
3331
|
*/
|
|
3317
3332
|
openapi: '3.0.0' | '3.0.1' | '3.0.2' | '3.0.3' | '3.0.4';
|
|
3318
|
-
|
|
3333
|
+
/**
|
|
3334
|
+
* **REQUIRED**. The available paths and operations for the API.
|
|
3335
|
+
*/
|
|
3336
|
+
paths: PathsObject;
|
|
3337
|
+
/**
|
|
3338
|
+
* A declaration of which security mechanisms can be used across the API. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. Individual operations can override this definition. The list can be incomplete, up to being empty or absent. To make security explicitly optional, an empty security requirement (`{}`) can be included in the array.
|
|
3339
|
+
*/
|
|
3340
|
+
security?: ReadonlyArray<SecurityRequirementObject>;
|
|
3341
|
+
/**
|
|
3342
|
+
* An array of Server Objects, which provide connectivity information to a target server. If the `servers` field is not provided, or is an empty array, the default value would be a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server-object Server Object} with a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server-url url} value of `/`.
|
|
3343
|
+
*/
|
|
3344
|
+
servers?: ReadonlyArray<ServerObject>;
|
|
3345
|
+
/**
|
|
3346
|
+
* A list of tags used by the OpenAPI Description with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#operation-object Operation Object} must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
|
|
3347
|
+
*/
|
|
3348
|
+
tags?: ReadonlyArray<TagObject>;
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
/**
|
|
3352
|
+
* A map of possible out-of band callbacks related to the parent operation. Each value in the map is a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-item-object Path Item Object} that describes a set of requests that may be initiated by the API provider and the expected responses. 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.
|
|
3353
|
+
*
|
|
3354
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3355
|
+
*
|
|
3356
|
+
* TODO: examples
|
|
3357
|
+
*/
|
|
3358
|
+
interface CallbackObject {
|
|
3359
|
+
/**
|
|
3360
|
+
* A Path Item Object used to define a callback request and expected responses. A {@link https://learn.openapis.org/examples/v3.0/callback-example.html complete example} is available.
|
|
3361
|
+
*/
|
|
3362
|
+
[expression: string]: PathItemObject | ReferenceObject;
|
|
3363
|
+
}
|
|
3364
|
+
|
|
3365
|
+
/**
|
|
3366
|
+
* Holds a set of reusable objects for different aspects of the OAS. All objects defined within the Components Object will have no effect on the API unless they are explicitly referenced from outside the Components Object.
|
|
3367
|
+
*
|
|
3368
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3369
|
+
*
|
|
3370
|
+
* All the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\.\-_]+$`.
|
|
3371
|
+
*
|
|
3372
|
+
* TODO: examples
|
|
3373
|
+
*/
|
|
3374
|
+
interface ComponentsObject {
|
|
3375
|
+
/**
|
|
3376
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#callback-object Callback Objects}.
|
|
3377
|
+
*/
|
|
3378
|
+
callbacks?: Record<string, CallbackObject | ReferenceObject>;
|
|
3379
|
+
/**
|
|
3380
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#example-object Example Objects}.
|
|
3381
|
+
*/
|
|
3382
|
+
examples?: Record<string, ExampleObject | ReferenceObject>;
|
|
3383
|
+
/**
|
|
3384
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#header-object Header Objects}.
|
|
3385
|
+
*/
|
|
3386
|
+
headers?: Record<string, HeaderObject | ReferenceObject>;
|
|
3387
|
+
/**
|
|
3388
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#link-object Link Objects}.
|
|
3389
|
+
*/
|
|
3390
|
+
linkes?: Record<string, LinkObject | ReferenceObject>;
|
|
3391
|
+
/**
|
|
3392
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-object Parameter Objects}.
|
|
3393
|
+
*/
|
|
3394
|
+
parameters?: Record<string, ParameterObject | ReferenceObject>;
|
|
3395
|
+
/**
|
|
3396
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#request-body-object Request Body Objects}.
|
|
3397
|
+
*/
|
|
3398
|
+
requestBodies?: Record<string, RequestBodyObject | ReferenceObject>;
|
|
3399
|
+
/**
|
|
3400
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#response-object Response Objects}.
|
|
3401
|
+
*/
|
|
3402
|
+
responses?: Record<string, ResponseObject | ReferenceObject>;
|
|
3403
|
+
/**
|
|
3404
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Objects}.
|
|
3405
|
+
*/
|
|
3406
|
+
schemas?: Record<string, SchemaObject | ReferenceObject>;
|
|
3407
|
+
/**
|
|
3408
|
+
* An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#security-scheme-object Security Scheme Objects}.
|
|
3409
|
+
*/
|
|
3410
|
+
securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3413
|
+
/**
|
|
3414
|
+
* Contact information for the exposed API.
|
|
3415
|
+
*
|
|
3416
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3417
|
+
*
|
|
3418
|
+
* ```yaml
|
|
3419
|
+
* name: API Support
|
|
3420
|
+
* url: https://www.example.com/support
|
|
3421
|
+
* email: support@example.com
|
|
3422
|
+
* ```
|
|
3423
|
+
*/
|
|
3424
|
+
interface ContactObject {
|
|
3425
|
+
/**
|
|
3426
|
+
* The email address of the contact person/organization. This MUST be in the form of an email address.
|
|
3427
|
+
*/
|
|
3428
|
+
email?: string;
|
|
3429
|
+
/**
|
|
3430
|
+
* The identifying name of the contact person/organization.
|
|
3431
|
+
*/
|
|
3432
|
+
name?: string;
|
|
3433
|
+
/**
|
|
3434
|
+
* The URL for the contact information. This MUST be in the form of a URL.
|
|
3435
|
+
*/
|
|
3436
|
+
url?: string;
|
|
3437
|
+
}
|
|
3438
|
+
|
|
3439
|
+
/**
|
|
3440
|
+
* When request bodies or response payloads may be one of a number of different schemas, a Discriminator Object gives a hint about the expected schema of the document. This hint can be used to aid in serialization, deserialization, and validation. The Discriminator Object does this by implicitly or explicitly associating the possible values of a named property with alternative schemas.
|
|
3441
|
+
*
|
|
3442
|
+
* Note that `discriminator` MUST NOT change the validation outcome of the schema.
|
|
3443
|
+
*
|
|
3444
|
+
* **Conditions for Using the Discriminator Object**
|
|
3445
|
+
*
|
|
3446
|
+
* TODO: content, examples
|
|
3447
|
+
*/
|
|
3448
|
+
interface DiscriminatorObject {
|
|
3449
|
+
/**
|
|
3450
|
+
* An object to hold mappings between payload values and schema names or URI references.
|
|
3451
|
+
*/
|
|
3452
|
+
mapping?: Record<string, string>;
|
|
3453
|
+
/**
|
|
3454
|
+
* **REQUIRED**. The name of the property in the payload that will hold the discriminating value. This property SHOULD be required in the payload schema, as the behavior when the property is absent is undefined.
|
|
3455
|
+
*/
|
|
3456
|
+
propertyName: string;
|
|
3319
3457
|
}
|
|
3320
3458
|
|
|
3321
|
-
|
|
3322
|
-
|
|
3459
|
+
/**
|
|
3460
|
+
* A single encoding definition applied to a single schema property. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-b-data-type-conversion Appendix B} for a discussion of converting values of various types to string representations.
|
|
3461
|
+
*
|
|
3462
|
+
* Properties are correlated with `multipart` parts using the {@link https://www.rfc-editor.org/rfc/rfc7578#section-4.2 `name` parameter} of `Content-Disposition: form-data`, and with `application/x-www-form-urlencoded` using the query string parameter names. In both cases, their order is implementation-defined.
|
|
3463
|
+
*
|
|
3464
|
+
* See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-e-percent-encoding-and-form-media-types Appendix E} for a detailed examination of percent-encoding concerns for form media types.
|
|
3465
|
+
*
|
|
3466
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3467
|
+
*
|
|
3468
|
+
* TODO: default values examples
|
|
3469
|
+
* TODO: examples
|
|
3470
|
+
*/
|
|
3471
|
+
interface EncodingObject {
|
|
3472
|
+
/**
|
|
3473
|
+
* When this is true, parameter values are serialized using reserved expansion, as defined by {@link https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3 RFC6570}, which allows {@link https://datatracker.ietf.org/doc/html/rfc3986#section-2.2 RFC3986's reserved character set}, as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are {@link https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 not allowed in the query string} (`[`, `]`, `#`), or have a special meaning in `application/x-www-form-urlencoded` (`-`, `&`, `+`); see Appendices {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-c-using-rfc6570-based-serialization C} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-e-percent-encoding-and-form-media-types E} for details. The default value is `false`. This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
|
|
3474
|
+
*/
|
|
3475
|
+
allowReserved?: boolean;
|
|
3476
|
+
/**
|
|
3477
|
+
* The `Content-Type` for encoding a specific property. The value is a comma-separated list, each element of which is either a specific media type (e.g. `image/png`) or a wildcard media type (e.g. `image/*`). Default value depends on the property type as shown in the table below.
|
|
3478
|
+
*/
|
|
3479
|
+
contentType?: string;
|
|
3480
|
+
/**
|
|
3481
|
+
* 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. For other types of properties this field has no effect. When {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#encoding-style `style`} is `"form"`, the default value is `true`. For all other styles, the default value is `false`. Note that despite `false` being the default for `deepObject`, the combination of `false` with `deepObject` is undefined. This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
|
|
3482
|
+
*/
|
|
3483
|
+
explode?: boolean;
|
|
3484
|
+
/**
|
|
3485
|
+
* A map allowing additional information to be provided as headers. `Content-Type` is described separately and SHALL be ignored in this section. This field SHALL be ignored if the request body media type is not a `multipart`.
|
|
3486
|
+
*/
|
|
3487
|
+
headers?: Record<string, HeaderObject | ReferenceObject>;
|
|
3488
|
+
/**
|
|
3489
|
+
* Describes how a specific property value will be serialized depending on its type. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-object Parameter Object} for details on the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-style `style`} field. The behavior follows the same values as `query` parameters, including default values. Note that the initial `?` used in query strings is not used in `application/x-www-form-urlencoded` message bodies, and MUST be removed (if using an RFC6570 implementation) or simply not added (if constructing the string manually). This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
|
|
3490
|
+
*/
|
|
3491
|
+
style?:
|
|
3492
|
+
| 'deepObject'
|
|
3493
|
+
| 'form'
|
|
3494
|
+
| 'label'
|
|
3495
|
+
| 'matrix'
|
|
3496
|
+
| 'pipeDelimited'
|
|
3497
|
+
| 'simple'
|
|
3498
|
+
| 'spaceDelimited';
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
/**
|
|
3502
|
+
* An object grouping an internal or external example value with basic `summary` and `description` metadata. This object is typically used in fields named `examples` (plural), and is a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#reference-object referenceable} alternative to older `example` (singular) fields that do not support referencing or metadata.
|
|
3503
|
+
*
|
|
3504
|
+
* Examples allow demonstration of the usage of properties, parameters and objects within OpenAPI.
|
|
3505
|
+
*
|
|
3506
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3507
|
+
*
|
|
3508
|
+
* In all cases, the example value SHOULD be compatible with the schema of its associated value. Tooling implementations MAY choose to validate compatibility automatically, and reject the example value(s) if incompatible.
|
|
3509
|
+
*
|
|
3510
|
+
* TODO: examples
|
|
3511
|
+
*/
|
|
3512
|
+
interface ExampleObject {
|
|
3513
|
+
/**
|
|
3514
|
+
* Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
3515
|
+
*/
|
|
3516
|
+
description?: string;
|
|
3517
|
+
/**
|
|
3518
|
+
* A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The `value` field and `externalValue` field are mutually exclusive. See the rules for resolving {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#relative-references-in-urls Relative References}.
|
|
3519
|
+
*/
|
|
3520
|
+
externalValue?: string;
|
|
3521
|
+
/**
|
|
3522
|
+
* Short description for the example.
|
|
3523
|
+
*/
|
|
3524
|
+
summary?: string;
|
|
3525
|
+
/**
|
|
3526
|
+
* Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
|
|
3527
|
+
*/
|
|
3528
|
+
value?: unknown;
|
|
3529
|
+
}
|
|
3530
|
+
|
|
3531
|
+
/**
|
|
3532
|
+
* Allows referencing an external resource for extended documentation.
|
|
3533
|
+
*
|
|
3534
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3535
|
+
*
|
|
3536
|
+
* **External Documentation Object Example**
|
|
3537
|
+
*
|
|
3538
|
+
* ```yaml
|
|
3539
|
+
* description: Find more info here
|
|
3540
|
+
* url: https://example.com
|
|
3541
|
+
* ```
|
|
3542
|
+
*/
|
|
3543
|
+
interface ExternalDocumentationObject {
|
|
3544
|
+
/**
|
|
3545
|
+
* A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
3546
|
+
*/
|
|
3547
|
+
description?: string;
|
|
3548
|
+
/**
|
|
3549
|
+
* **REQUIRED**. The URL for the target documentation. This MUST be in the form of a URL.
|
|
3550
|
+
*/
|
|
3551
|
+
url: string;
|
|
3552
|
+
}
|
|
3553
|
+
|
|
3554
|
+
/**
|
|
3555
|
+
* Describes a single header for {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#response-headers HTTP responses} and for {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#encoding-headers individual parts in `multipart` representations}; see the relevant {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#response-object Response Object} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#encoding-object Encoding Object} documentation for restrictions on which headers can be described.
|
|
3556
|
+
*
|
|
3557
|
+
* The Header Object follows the structure of the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-object Parameter Object}, including determining its serialization strategy based on whether `schema` or `content` is present, with the following changes:
|
|
3558
|
+
* 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
|
|
3559
|
+
* 1. `in` MUST NOT be specified, it is implicitly in `header`.
|
|
3560
|
+
* 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-style `style`}). This means that `allowEmptyValue` and `allowReserved` MUST NOT be used, and `style`, if used, MUST be limited to `"simple"`.
|
|
3561
|
+
*
|
|
3562
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3563
|
+
*
|
|
3564
|
+
* TODO: examples
|
|
3565
|
+
*/
|
|
3566
|
+
interface HeaderObject extends Omit<ParameterObject, 'in' | 'name'> {}
|
|
3567
|
+
|
|
3568
|
+
/**
|
|
3569
|
+
* The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
|
|
3570
|
+
*
|
|
3571
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3572
|
+
*
|
|
3573
|
+
* ```yaml
|
|
3574
|
+
* title: Example Pet Store App
|
|
3575
|
+
* description: This is an example server for a pet store.
|
|
3576
|
+
* termsOfService: https://example.com/terms/
|
|
3577
|
+
* contact:
|
|
3578
|
+
* name: API Support
|
|
3579
|
+
* url: https://www.example.com/support
|
|
3580
|
+
* email: support@example.com
|
|
3581
|
+
* license:
|
|
3582
|
+
* name: Apache 2.0
|
|
3583
|
+
* url: https://www.apache.org/licenses/LICENSE-2.0.html
|
|
3584
|
+
* version: 1.0.1
|
|
3585
|
+
* ```
|
|
3586
|
+
*/
|
|
3587
|
+
interface InfoObject {
|
|
3588
|
+
/**
|
|
3589
|
+
* The contact information for the exposed API.
|
|
3590
|
+
*/
|
|
3591
|
+
contact?: ContactObject;
|
|
3592
|
+
/**
|
|
3593
|
+
* A description of the API. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
3594
|
+
*/
|
|
3595
|
+
description?: string;
|
|
3596
|
+
/**
|
|
3597
|
+
* The license information for the exposed API.
|
|
3598
|
+
*/
|
|
3599
|
+
license?: LicenseObject;
|
|
3600
|
+
/**
|
|
3601
|
+
* A URL for the Terms of Service for the API. This MUST be in the form of a URL.
|
|
3602
|
+
*/
|
|
3603
|
+
termsOfService?: string;
|
|
3604
|
+
/**
|
|
3605
|
+
* **REQUIRED**. The title of the API.
|
|
3606
|
+
*/
|
|
3607
|
+
title: string;
|
|
3608
|
+
/**
|
|
3609
|
+
* **REQUIRED**. The version of the OpenAPI Document (which is distinct from the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#oas-version OpenAPI Specification version} or the version of the API being described or the version of the OpenAPI Description).
|
|
3610
|
+
*/
|
|
3611
|
+
version: string;
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
/**
|
|
3615
|
+
* License information for the exposed API.
|
|
3616
|
+
*
|
|
3617
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3618
|
+
*
|
|
3619
|
+
* ```yaml
|
|
3620
|
+
* name: Apache 2.0
|
|
3621
|
+
* url: https://www.apache.org/licenses/LICENSE-2.0.html
|
|
3622
|
+
* ```
|
|
3623
|
+
*/
|
|
3624
|
+
interface LicenseObject {
|
|
3625
|
+
/**
|
|
3626
|
+
* **REQUIRED**. The license name used for the API.
|
|
3627
|
+
*/
|
|
3628
|
+
name: string;
|
|
3629
|
+
/**
|
|
3630
|
+
* A URL for the license used for the API. This MUST be in the form of a URL.
|
|
3631
|
+
*/
|
|
3632
|
+
url?: string;
|
|
3633
|
+
}
|
|
3634
|
+
|
|
3635
|
+
/**
|
|
3636
|
+
* The Link Object represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
|
|
3637
|
+
*
|
|
3638
|
+
* Unlike _dynamic links_ (i.e. links provided in the response payload), the OAS linking mechanism does not require link information in the runtime response.
|
|
3639
|
+
*
|
|
3640
|
+
* For computing links and providing instructions to execute them, a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#runtime-expressions runtime expression} is used for accessing values in an operation and using them as parameters while invoking the linked operation.
|
|
3641
|
+
*
|
|
3642
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3643
|
+
*
|
|
3644
|
+
* A linked operation MUST be identified using either an `operationRef` or `operationId`. The identified or reference operation MUST be unique, and in the case of an `operationId`, it MUST be resolved within the scope of the OpenAPI Description (OAD). Because of the potential for name clashes, the `operationRef` syntax is preferred for multi-document OADs. However, because use of an operation depends on its URL path template in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#paths-object Paths Object}, operations from any {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-item-object Path Item Object} that is referenced multiple times within the OAD cannot be resolved unambiguously. In such ambiguous cases, the resulting behavior is implementation-defined and MAY result in an error.
|
|
3645
|
+
*
|
|
3646
|
+
* Note that it is not possible to provide a constant value to `parameters` that matches the syntax of a runtime expression. It is possible to have ambiguous parameter names, e.g. `name: "id"`, `in: "path"` and `name: "path.id", in: "query"`; this is NOT RECOMMENDED and the behavior is implementation-defined, however implementations SHOULD prefer the qualified interpretation (`path.id` as a path parameter), as the names can always be qualified to disambiguate them (e.g. using `query.path.id` for the query parameter).
|
|
3647
|
+
*
|
|
3648
|
+
* TODO: examples
|
|
3649
|
+
*/
|
|
3650
|
+
interface LinkObject {
|
|
3651
|
+
/**
|
|
3652
|
+
* A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
3653
|
+
*/
|
|
3654
|
+
description?: string;
|
|
3655
|
+
/**
|
|
3656
|
+
* The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive of the `operationRef` field.
|
|
3657
|
+
*/
|
|
3658
|
+
operationId?: string;
|
|
3659
|
+
/**
|
|
3660
|
+
* A URI reference to an OAS operation. This field is mutually exclusive of the `operationId` field, and MUST point to an {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#operation-object Operation Object}.
|
|
3661
|
+
*/
|
|
3662
|
+
operationRef?: string;
|
|
3663
|
+
/**
|
|
3664
|
+
* A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used (optionally qualified with the parameter location, e.g. `path.id` for an `id` parameter in the path), whereas the value can be a constant or an expression to be evaluated and passed to the linked operation.
|
|
3665
|
+
*/
|
|
3666
|
+
parameters?: Record<string, unknown | string>;
|
|
3667
|
+
/**
|
|
3668
|
+
* A literal value or {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#runtime-expressions {expression}} to use as a request body when calling the target operation.
|
|
3669
|
+
*/
|
|
3670
|
+
requestBody?: unknown | string;
|
|
3671
|
+
/**
|
|
3672
|
+
* A server object to be used by the target operation.
|
|
3673
|
+
*/
|
|
3674
|
+
server?: ServerObject;
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3677
|
+
/**
|
|
3678
|
+
* Each Media Type Object provides schema and examples for the media type identified by its key.
|
|
3679
|
+
*
|
|
3680
|
+
* When `example` or `examples` are provided, the example SHOULD match the specified schema and be in the correct format as specified by the media type and its encoding. The `example` and `examples` fields are mutually exclusive, and if either is present it SHALL _override_ any `example` in the schema. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#working-with-examples Working With Examples} for further guidance regarding the different ways of specifying examples, including non-JSON/YAML values.
|
|
3681
|
+
*
|
|
3682
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3683
|
+
*
|
|
3684
|
+
* TODO: examples
|
|
3685
|
+
*/
|
|
3686
|
+
interface MediaTypeObject {
|
|
3687
|
+
/**
|
|
3688
|
+
* A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The `encoding` field SHALL only apply to {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#request-body-object Request Body Objects}, and only when the media type is `multipart` or `application/x-www-form-urlencoded`. If no Encoding Object is provided for a property, the behavior is determined by the default values documented for the Encoding Object.
|
|
3689
|
+
*/
|
|
3690
|
+
encoding?: Record<string, EncodingObject>;
|
|
3691
|
+
/**
|
|
3692
|
+
* Example of the media type; see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#working-with-examples Working With Examples}.
|
|
3693
|
+
*/
|
|
3694
|
+
example?: unknown;
|
|
3695
|
+
/**
|
|
3696
|
+
* Examples of the media type; see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#working-with-examples Working With Examples}.
|
|
3697
|
+
*/
|
|
3698
|
+
examples?: Record<string, ExampleObject | ReferenceObject>;
|
|
3699
|
+
/**
|
|
3700
|
+
* The schema defining the content of the request, response, parameter, or header.
|
|
3701
|
+
*/
|
|
3702
|
+
schema?: SchemaObject | ReferenceObject;
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3705
|
+
/**
|
|
3706
|
+
* Configuration details for a supported OAuth Flow
|
|
3707
|
+
*
|
|
3708
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3709
|
+
*
|
|
3710
|
+
* TODO: examples
|
|
3711
|
+
*/
|
|
3712
|
+
interface OAuthFlowObject {
|
|
3713
|
+
/**
|
|
3714
|
+
* **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
|
|
3715
|
+
*/
|
|
3716
|
+
authorizationUrl: string;
|
|
3717
|
+
/**
|
|
3718
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
|
|
3719
|
+
*/
|
|
3720
|
+
refreshUrl?: string;
|
|
3721
|
+
/**
|
|
3722
|
+
* **REQUIRED**. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty.
|
|
3723
|
+
*/
|
|
3724
|
+
scopes: Record<string, string>;
|
|
3725
|
+
/**
|
|
3726
|
+
* **REQUIRED**. The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
|
|
3727
|
+
*/
|
|
3728
|
+
tokenUrl: string;
|
|
3729
|
+
}
|
|
3730
|
+
|
|
3731
|
+
/**
|
|
3732
|
+
* Allows configuration of the supported OAuth Flows.
|
|
3733
|
+
*
|
|
3734
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3735
|
+
*/
|
|
3736
|
+
interface OAuthFlowsObject {
|
|
3737
|
+
/**
|
|
3738
|
+
* Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
|
|
3739
|
+
*/
|
|
3740
|
+
authorizationCode?: OAuthFlowObject;
|
|
3741
|
+
/**
|
|
3742
|
+
* Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
|
|
3743
|
+
*/
|
|
3744
|
+
clientCredentials?: OAuthFlowObject;
|
|
3745
|
+
/**
|
|
3746
|
+
* Configuration for the OAuth Implicit flow
|
|
3747
|
+
*/
|
|
3748
|
+
implicit?: OAuthFlowObject;
|
|
3749
|
+
/**
|
|
3750
|
+
* Configuration for the OAuth Resource Owner Password flow
|
|
3751
|
+
*/
|
|
3752
|
+
password?: OAuthFlowObject;
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
/**
|
|
3756
|
+
* Describes a single API operation on a path.
|
|
3757
|
+
*
|
|
3758
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3759
|
+
*
|
|
3760
|
+
* TODO: examples
|
|
3761
|
+
*/
|
|
3762
|
+
interface OperationObject {
|
|
3763
|
+
/**
|
|
3764
|
+
* A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#callback-object Callback Object} that describes a request that may be initiated by the API provider and the expected responses.
|
|
3765
|
+
*/
|
|
3766
|
+
callbacks?: Record<string, CallbackObject | ReferenceObject>;
|
|
3767
|
+
/**
|
|
3768
|
+
* Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
|
|
3769
|
+
*/
|
|
3770
|
+
deprecated?: boolean;
|
|
3771
|
+
/**
|
|
3772
|
+
* A verbose explanation of the operation behavior. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
3773
|
+
*/
|
|
3774
|
+
description?: string;
|
|
3775
|
+
/**
|
|
3776
|
+
* Additional external documentation for this operation.
|
|
3777
|
+
*/
|
|
3778
|
+
externalDocs?: ExternalDocumentationObject;
|
|
3779
|
+
/**
|
|
3780
|
+
* Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
|
|
3781
|
+
*/
|
|
3782
|
+
operationId?: string;
|
|
3783
|
+
/**
|
|
3784
|
+
* A list of parameters that are applicable for this operation. If a parameter is already defined in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-item-parameters Path Item}, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-name name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-in location}. The list can use the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#reference-object Reference Object} to link to parameters that are defined in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-parameters OpenAPI Object's `components.parameters`}.
|
|
3785
|
+
*/
|
|
3786
|
+
parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
|
|
3787
|
+
/**
|
|
3788
|
+
* The request body applicable for this operation. The `requestBody` is only supported in HTTP methods where the HTTP 1.1 specification {@link https://tools.ietf.org/html/rfc7231#section-4.3.1 RFC7231} has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as {@link https://tools.ietf.org/html/rfc7231#section-4.3.1 GET}, {@link https://tools.ietf.org/html/rfc7231#section-4.3.2 HEAD} and {@link https://tools.ietf.org/html/rfc7231#section-4.3.5 DELETE}), `requestBody` SHALL be ignored by consumers.
|
|
3789
|
+
*/
|
|
3790
|
+
requestBody?: RequestBodyObject | ReferenceObject;
|
|
3791
|
+
/**
|
|
3792
|
+
* **REQUIRED**. The list of possible responses as they are returned from executing this operation.
|
|
3793
|
+
*/
|
|
3794
|
+
responses: ResponsesObject;
|
|
3795
|
+
/**
|
|
3796
|
+
* A declaration of which security mechanisms can be used for this operation. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. To make security optional, an empty security requirement (`{}`) can be included in the array. This definition overrides any declared top-level {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#oas-security `security`}. To remove a top-level security declaration, an empty array can be used.
|
|
3797
|
+
*/
|
|
3798
|
+
security?: ReadonlyArray<SecurityRequirementObject>;
|
|
3799
|
+
/**
|
|
3800
|
+
* An alternative `servers` array to service this operation. If a `servers` array is specified at the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-item-servers Path Item Object} or {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#oas-servers OpenAPI Object} level, it will be overridden by this value.
|
|
3801
|
+
*/
|
|
3802
|
+
servers?: ReadonlyArray<ServerObject>;
|
|
3803
|
+
/**
|
|
3804
|
+
* A short summary of what the operation does.
|
|
3805
|
+
*/
|
|
3806
|
+
summary?: string;
|
|
3807
|
+
/**
|
|
3808
|
+
* A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
|
|
3809
|
+
*/
|
|
3810
|
+
tags?: ReadonlyArray<string>;
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
/**
|
|
3814
|
+
* Describes a single operation parameter.
|
|
3815
|
+
*
|
|
3816
|
+
* A unique parameter is defined by a combination of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-name name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-in location}.
|
|
3817
|
+
*
|
|
3818
|
+
* See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-e-percent-encoding-and-form-media-types Appendix E} for a detailed examination of percent-encoding concerns, including interactions with the `application/x-www-form-urlencoded` query string format.
|
|
3819
|
+
*
|
|
3820
|
+
* **Parameter Locations**
|
|
3821
|
+
*
|
|
3822
|
+
* There are four possible parameter locations specified by the `in` field:
|
|
3823
|
+
*
|
|
3824
|
+
* - path - Used together with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-templating Path Templating}, where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
|
|
3825
|
+
* - query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
|
|
3826
|
+
* - header - Custom headers that are expected as part of the request. Note that {@link https://tools.ietf.org/html/rfc7230#section-3.2 RFC7230} states header names are case insensitive.
|
|
3827
|
+
* - cookie - Used to pass a specific cookie value to the API.
|
|
3828
|
+
*
|
|
3829
|
+
* **Fixed Fields**
|
|
3830
|
+
*
|
|
3831
|
+
* The rules for serialization of the parameter are specified in one of two ways. Parameter Objects MUST include either a `content` field or a `schema` field, but not both. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-b-data-type-conversion Appendix B} for a discussion of converting values of various types to string representations.
|
|
3832
|
+
*
|
|
3833
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3834
|
+
*
|
|
3835
|
+
* Note that while `"Cookie"` as a `name` is not forbidden if `in` is `"header"`, the effect of defining a cookie parameter that way is undefined; use `in: "cookie"` instead.
|
|
3836
|
+
*
|
|
3837
|
+
* **Fixed Fields for use with schema**
|
|
3838
|
+
*
|
|
3839
|
+
* For simpler scenarios, a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-schema `schema`} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-style `style`} can describe the structure and syntax of the parameter. When `example` or `examples` are provided in conjunction with the `schema` field, the example SHOULD match the specified schema and follow the prescribed serialization strategy for the parameter. The `example` and `examples` fields are mutually exclusive, and if either is present it SHALL _override_ any `example` in the schema.
|
|
3840
|
+
*
|
|
3841
|
+
* Serializing with `schema` is NOT RECOMMENDED for `in: "cookie"` parameters, `in: "header"` parameters that use HTTP header parameters (name=value pairs following a `;`) in their values, or `in: "header"` parameters where values might have non-URL-safe characters; see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-d-serializing-headers-and-cookies Appendix D} for details.
|
|
3842
|
+
*
|
|
3843
|
+
* See also {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-c-using-rfc6570-based-serialization Appendix C: Using RFC6570-Based Serialization} for additional guidance.
|
|
3844
|
+
*
|
|
3845
|
+
* **Fixed Fields for use with `content`**
|
|
3846
|
+
*
|
|
3847
|
+
* For more complex scenarios, the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-content `content`} field can define the media type and schema of the parameter, as well as give examples of its use. Using `content` with a `text/plain` media type is RECOMMENDED for `in: "header"` and `in: "cookie"` parameters where the `schema` strategy is not appropriate.
|
|
3848
|
+
*
|
|
3849
|
+
* **Style Values**
|
|
3850
|
+
*
|
|
3851
|
+
* In order to support common ways of serializing simple parameters, a set of `style` values are defined.
|
|
3852
|
+
*
|
|
3853
|
+
* See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-e-percent-encoding-and-form-media-types Appendix E} for a discussion of percent-encoding, including when delimiters need to be percent-encoded and options for handling collisions with percent-encoded data.
|
|
3854
|
+
*
|
|
3855
|
+
* TODO: examples
|
|
3856
|
+
*/
|
|
3857
|
+
interface ParameterObject {
|
|
3858
|
+
/**
|
|
3859
|
+
* If `true`, clients MAY pass a zero-length string value in place of parameters that would otherwise be omitted entirely, which the server SHOULD interpret as the parameter being unused. Default value is `false`. If {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-style `style`} is used, and if {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#style-examples behavior is _n/a_ (cannot be serialized)}, the value of `allowEmptyValue` SHALL be ignored. Interactions between this field and the parameter's {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} are implementation-defined. This field is valid only for `query` parameters. Use of this field is NOT RECOMMENDED, and it is likely to be removed in a later revision.
|
|
3860
|
+
*/
|
|
3861
|
+
allowEmptyValue?: boolean;
|
|
3862
|
+
/**
|
|
3863
|
+
* When this is true, parameter values are serialized using reserved expansion, as defined by {@link https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3 RFC6570}, which allows {@link https://datatracker.ietf.org/doc/html/rfc3986#section-2.2 RFC3986's reserved character set}, as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are {@link https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 not allowed in the query string} (`[`, `]`, `#`), or have a special meaning in `application/x-www-form-urlencoded` (`-`, `&`, `+`); see Appendices {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-c-using-rfc6570-based-serialization C} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-e-percent-encoding-and-form-media-types E} for details. This field only applies to parameters with an `in` value of `query`. The default value is `false`.
|
|
3864
|
+
*/
|
|
3865
|
+
allowReserved?: boolean;
|
|
3866
|
+
/**
|
|
3867
|
+
* A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
|
|
3868
|
+
*/
|
|
3869
|
+
content?: Record<string, MediaTypeObject>;
|
|
3870
|
+
/**
|
|
3871
|
+
* Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
|
|
3872
|
+
*/
|
|
3873
|
+
deprecated?: boolean;
|
|
3874
|
+
/**
|
|
3875
|
+
* A brief description of the parameter. This could contain examples of use. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
3876
|
+
*/
|
|
3877
|
+
description?: string;
|
|
3878
|
+
/**
|
|
3879
|
+
* Example of the parameter's potential value; see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#working-with-examples Working With Examples}.
|
|
3880
|
+
*/
|
|
3881
|
+
example?: unknown;
|
|
3882
|
+
/**
|
|
3883
|
+
* Examples of the parameter's potential value; see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#working-with-examples Working With Examples}.
|
|
3884
|
+
*/
|
|
3885
|
+
examples?: Record<string, ExampleObject | ReferenceObject>;
|
|
3886
|
+
/**
|
|
3887
|
+
* 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. For other types of parameters this field has no effect. When {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-style `style`} is `"form"`, the default value is `true`. For all other styles, the default value is `false`. Note that despite `false` being the default for `deepObject`, the combination of `false` with `deepObject` is undefined.
|
|
3888
|
+
*/
|
|
3889
|
+
explode?: boolean;
|
|
3890
|
+
/**
|
|
3891
|
+
* **REQUIRED**. The location of the parameter. Possible values are `"query"`, `"header"`, `"path"` or `"cookie"`.
|
|
3892
|
+
*/
|
|
3893
|
+
in: 'cookie' | 'header' | 'path' | 'query';
|
|
3894
|
+
/**
|
|
3895
|
+
* **REQUIRED**. The name of the parameter. Parameter names are _case sensitive_.
|
|
3896
|
+
* - If {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-in `in`} is `"path"`, the `name` field MUST correspond to a template expression occurring within the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#paths-path path} field in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#paths-object Paths Object}. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-templating Path Templating} for further information.
|
|
3897
|
+
* - If {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-in `in`} is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
|
|
3898
|
+
* - For all other cases, the `name` corresponds to the parameter name used by the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-in `in`} field.
|
|
3899
|
+
*/
|
|
3900
|
+
name: string;
|
|
3901
|
+
/**
|
|
3902
|
+
* Determines whether this parameter is mandatory. If the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-in parameter location} is `"path"`, this field is **REQUIRED** and its value MUST be `true`. Otherwise, the field MAY be included and its default value is `false`.
|
|
3903
|
+
*/
|
|
3904
|
+
required?: boolean;
|
|
3905
|
+
/**
|
|
3906
|
+
* The schema defining the type used for the parameter.
|
|
3907
|
+
*/
|
|
3908
|
+
schema?: SchemaObject | ReferenceObject;
|
|
3909
|
+
/**
|
|
3910
|
+
* Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `"query"` - `"form"`; for `"path"` - `"simple"`; for `"header"` - `"simple"`; for `"cookie"` - `"form"`.
|
|
3911
|
+
*/
|
|
3912
|
+
style?:
|
|
3913
|
+
| 'deepObject'
|
|
3914
|
+
| 'form'
|
|
3915
|
+
| 'label'
|
|
3916
|
+
| 'matrix'
|
|
3917
|
+
| 'pipeDelimited'
|
|
3918
|
+
| 'simple'
|
|
3919
|
+
| 'spaceDelimited';
|
|
3920
|
+
}
|
|
3921
|
+
|
|
3922
|
+
/**
|
|
3923
|
+
* Describes the operations available on a single path. A Path Item MAY be empty, due to {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#security-filtering ACL constraints}. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
|
|
3924
|
+
*
|
|
3925
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3926
|
+
*
|
|
3927
|
+
* TODO: examples
|
|
3928
|
+
*/
|
|
3929
|
+
interface PathItemObject {
|
|
3930
|
+
/**
|
|
3931
|
+
* Allows for a referenced definition of this path item. The value MUST be in the form of a URL, and the referenced structure MUST be in the form of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-item-object Path Item Object}. In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#relative-references-in-urls Relative References}.
|
|
3932
|
+
*/
|
|
3933
|
+
$ref?: string;
|
|
3934
|
+
/**
|
|
3935
|
+
* A definition of a DELETE operation on this path.
|
|
3936
|
+
*/
|
|
3937
|
+
delete?: OperationObject;
|
|
3938
|
+
/**
|
|
3939
|
+
* An optional string description, intended to apply to all operations in this path. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
3940
|
+
*/
|
|
3941
|
+
description?: string;
|
|
3942
|
+
/**
|
|
3943
|
+
* A definition of a GET operation on this path.
|
|
3944
|
+
*/
|
|
3945
|
+
get?: OperationObject;
|
|
3946
|
+
/**
|
|
3947
|
+
* A definition of a HEAD operation on this path.
|
|
3948
|
+
*/
|
|
3949
|
+
head?: OperationObject;
|
|
3950
|
+
/**
|
|
3951
|
+
* A definition of a OPTIONS operation on this path.
|
|
3952
|
+
*/
|
|
3953
|
+
options?: OperationObject;
|
|
3954
|
+
/**
|
|
3955
|
+
* A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-name name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-in location}. The list can use the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#reference-object Reference Object} to link to parameters that are defined in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-parameters OpenAPI Object's `components.parameters`}.
|
|
3956
|
+
*/
|
|
3957
|
+
parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
|
|
3958
|
+
/**
|
|
3959
|
+
* A definition of a PATCH operation on this path.
|
|
3960
|
+
*/
|
|
3961
|
+
patch?: OperationObject;
|
|
3962
|
+
/**
|
|
3963
|
+
* A definition of a POST operation on this path.
|
|
3964
|
+
*/
|
|
3965
|
+
post?: OperationObject;
|
|
3966
|
+
/**
|
|
3967
|
+
* A definition of a PUT operation on this path.
|
|
3968
|
+
*/
|
|
3969
|
+
put?: OperationObject;
|
|
3970
|
+
/**
|
|
3971
|
+
* An alternative `servers` array to service all operations in this path. If a `servers` array is specified at the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#oas-servers OpenAPI Object} level, it will be overridden by this value.
|
|
3972
|
+
*/
|
|
3973
|
+
servers?: ReadonlyArray<ServerObject>;
|
|
3974
|
+
/**
|
|
3975
|
+
* An optional string summary, intended to apply to all operations in this path.
|
|
3976
|
+
*/
|
|
3977
|
+
summary?: string;
|
|
3978
|
+
/**
|
|
3979
|
+
* A definition of a TRACE operation on this path.
|
|
3980
|
+
*/
|
|
3981
|
+
trace?: OperationObject;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
/**
|
|
3985
|
+
* Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server-object Server Object} in order to construct the full URL. The Paths Object MAY be empty, due to {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#security-filtering Access Control List (ACL) constraints}.
|
|
3986
|
+
*
|
|
3987
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
3988
|
+
*
|
|
3989
|
+
* TODO: examples
|
|
3990
|
+
*/
|
|
3991
|
+
interface PathsObject {
|
|
3992
|
+
/**
|
|
3993
|
+
* A relative path to an individual endpoint. The field name MUST begin with a forward slash (`/`). The path is **appended** (no relative URL resolution) to the expanded URL from the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server-object Server Object}'s `url` field in order to construct the full URL. {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-templating Path templating} is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
|
|
3994
|
+
*/
|
|
3995
|
+
[path: `/${string}`]: PathItemObject;
|
|
3996
|
+
}
|
|
3997
|
+
|
|
3998
|
+
/**
|
|
3999
|
+
* A simple object to allow referencing other components in the OpenAPI Description, internally and externally.
|
|
4000
|
+
*
|
|
4001
|
+
* The Reference Object is defined by {@link https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 JSON Reference} and follows the same structure, behavior and rules.
|
|
4002
|
+
*
|
|
4003
|
+
* For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification.
|
|
4004
|
+
*
|
|
4005
|
+
* This object cannot be extended with additional properties, and any properties added SHALL be ignored.
|
|
4006
|
+
*
|
|
4007
|
+
* **Reference Object Example**
|
|
4008
|
+
*
|
|
4009
|
+
* ```yaml
|
|
4010
|
+
* $ref: '#/components/schemas/Pet'
|
|
4011
|
+
* ```
|
|
4012
|
+
*
|
|
4013
|
+
* **Relative Schema Document Example**
|
|
4014
|
+
*
|
|
4015
|
+
* ```yaml
|
|
4016
|
+
* $ref: Pet.yaml
|
|
4017
|
+
* ```
|
|
4018
|
+
*
|
|
4019
|
+
* **Relative Documents with Embedded Schema Example**
|
|
4020
|
+
*
|
|
4021
|
+
* ```yaml
|
|
4022
|
+
* $ref: definitions.yaml#/Pet
|
|
4023
|
+
* ```
|
|
4024
|
+
*/
|
|
4025
|
+
interface ReferenceObject {
|
|
4026
|
+
/**
|
|
4027
|
+
* **REQUIRED**. The reference string.
|
|
4028
|
+
*/
|
|
4029
|
+
$ref: string;
|
|
4030
|
+
}
|
|
4031
|
+
|
|
4032
|
+
/**
|
|
4033
|
+
* Describes a single request body.
|
|
4034
|
+
*
|
|
4035
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4036
|
+
*
|
|
4037
|
+
* TODO: examples
|
|
4038
|
+
*/
|
|
4039
|
+
interface RequestBodyObject {
|
|
4040
|
+
/**
|
|
4041
|
+
* **REQUIRED**. The content of the request body. The key is a media type or {@link https://tools.ietf.org/html/rfc7231#appendix-D media type range} and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. `"text/plain"` overrides `"text/*"`
|
|
4042
|
+
*/
|
|
4043
|
+
content: Record<string, MediaTypeObject>;
|
|
4044
|
+
/**
|
|
4045
|
+
* A brief description of the request body. This could contain examples of use. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
4046
|
+
*/
|
|
4047
|
+
description?: string;
|
|
4048
|
+
/**
|
|
4049
|
+
* Determines if the request body is required in the request. Defaults to `false`.
|
|
4050
|
+
*/
|
|
4051
|
+
required?: boolean;
|
|
4052
|
+
}
|
|
4053
|
+
|
|
4054
|
+
/**
|
|
4055
|
+
* Describes a single response from an API operation, including design-time, static `links` to operations based on the response.
|
|
4056
|
+
*
|
|
4057
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4058
|
+
*
|
|
4059
|
+
* TODO: examples
|
|
4060
|
+
*/
|
|
4061
|
+
interface ResponseObject {
|
|
4062
|
+
/**
|
|
4063
|
+
* A map containing descriptions of potential response payloads. The key is a media type or {@link https://tools.ietf.org/html/rfc7231#appendix-D media type range} and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. `"text/plain"` overrides `"text/*"`
|
|
4064
|
+
*/
|
|
4065
|
+
content?: Record<string, MediaTypeObject>;
|
|
4066
|
+
/**
|
|
4067
|
+
* **REQUIRED**. A description of the response. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
4068
|
+
*/
|
|
4069
|
+
description: string;
|
|
4070
|
+
/**
|
|
4071
|
+
* Maps a header name to its definition. {@link https://tools.ietf.org/html/rfc7230#section-3.2 RFC7230} states header names are case insensitive. If a response header is defined with the name `"Content-Type"`, it SHALL be ignored.
|
|
4072
|
+
*/
|
|
4073
|
+
headers?: Record<string, HeaderObject | ReferenceObject>;
|
|
4074
|
+
/**
|
|
4075
|
+
* A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-object Component Objects}.
|
|
4076
|
+
*/
|
|
4077
|
+
links?: Record<string, LinkObject | ReferenceObject>;
|
|
4078
|
+
}
|
|
4079
|
+
|
|
4080
|
+
/**
|
|
4081
|
+
* A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
|
|
4082
|
+
*
|
|
4083
|
+
* The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors.
|
|
4084
|
+
*
|
|
4085
|
+
* The `default` MAY be used as a default Response Object for all HTTP codes that are not covered individually by the Responses Object.
|
|
4086
|
+
*
|
|
4087
|
+
* The Responses Object MUST contain at least one response code, and if only one response code is provided it SHOULD be the response for a successful operation call.
|
|
4088
|
+
*
|
|
4089
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4090
|
+
*
|
|
4091
|
+
* TODO: examples
|
|
4092
|
+
*/
|
|
4093
|
+
interface ResponsesObject {
|
|
4094
|
+
/**
|
|
4095
|
+
* Any {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#http-status-codes HTTP status code} can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. A {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#reference-object Reference Object} can link to a response that is defined in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-responses OpenAPI Object's `components.responses`} section. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `200` and `299`. Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
|
|
4096
|
+
*/
|
|
4097
|
+
[httpStatusCode: string]: ResponseObject | ReferenceObject | undefined;
|
|
4098
|
+
/**
|
|
4099
|
+
* The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. A {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#reference-object Reference Object} can link to a response that the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-responses OpenAPI Object's `components.responses`} section defines.
|
|
4100
|
+
*/
|
|
4101
|
+
default?: ResponseObject | ReferenceObject;
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
/**
|
|
4105
|
+
* The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the [[JSON-Schema-05|JSON Schema Specification Draft Wright-00]].
|
|
4106
|
+
*
|
|
4107
|
+
* For more information about the keywords, see {@link https://tools.ietf.org/html/draft-wright-json-schema-00 JSON Schema Core} and {@link https://tools.ietf.org/html/draft-wright-json-schema-validation-00 JSON Schema Validation}. Unless stated otherwise, the keyword definitions follow those of JSON Schema and do not add any additional semantics.
|
|
4108
|
+
*
|
|
4109
|
+
* **JSON Schema Keywords**
|
|
4110
|
+
*
|
|
4111
|
+
* The following keywords are taken directly from the JSON Schema definition and follow the same specifications:
|
|
4112
|
+
* - title
|
|
4113
|
+
* - multipleOf
|
|
4114
|
+
* - maximum
|
|
4115
|
+
* - exclusiveMaximum
|
|
4116
|
+
* - minimum
|
|
4117
|
+
* - exclusiveMinimum
|
|
4118
|
+
* - maxLength
|
|
4119
|
+
* - minLength
|
|
4120
|
+
* - pattern (This string SHOULD be a valid regular expression, according to the {@link https://www.ecma-international.org/ecma-262/5.1/#sec-15.10.1 Ecma-262 Edition 5.1 regular expression} dialect)
|
|
4121
|
+
* - maxItems
|
|
4122
|
+
* - minItems
|
|
4123
|
+
* - uniqueItems
|
|
4124
|
+
* - maxProperties
|
|
4125
|
+
* - minProperties
|
|
4126
|
+
* - required
|
|
4127
|
+
* - enum
|
|
4128
|
+
*
|
|
4129
|
+
* The following keywords are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification.
|
|
4130
|
+
*
|
|
4131
|
+
* - type - Value MUST be a string. Multiple types via an array are not supported.
|
|
4132
|
+
* - allOf - Inline or referenced schema MUST be of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} and not a standard JSON Schema.
|
|
4133
|
+
* - oneOf - Inline or referenced schema MUST be of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} and not a standard JSON Schema.
|
|
4134
|
+
* - anyOf - Inline or referenced schema MUST be of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} and not a standard JSON Schema.
|
|
4135
|
+
* - not - Inline or referenced schema MUST be of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} and not a standard JSON Schema.
|
|
4136
|
+
* - items - Value MUST be an object and not an array. Inline or referenced schema MUST be of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} and not a standard JSON Schema. `items` MUST be present if `type` is `"array"`.
|
|
4137
|
+
* - properties - Property definitions MUST be a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} and not a standard JSON Schema (inline or referenced).
|
|
4138
|
+
* - additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} and not a standard JSON Schema. Consistent with JSON Schema, `additionalProperties` defaults to `true`.
|
|
4139
|
+
* - description - {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
4140
|
+
* - format - See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#data-type-format Data Type Formats} for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.
|
|
4141
|
+
* - default - The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined `type` for the Schema Object defined at the same level. For example, if `type` is `"string"`, then `default` can be `"foo"` but cannot be `1`.
|
|
4142
|
+
*
|
|
4143
|
+
* Alternatively, any time a Schema Object can be used, a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#reference-object Reference Object} can be used in its place. This allows referencing definitions instead of defining them inline.
|
|
4144
|
+
*
|
|
4145
|
+
* Additional keywords defined by the JSON Schema specification that are not mentioned here are strictly unsupported.
|
|
4146
|
+
*
|
|
4147
|
+
* Other than the JSON Schema subset fields, the following fields MAY be used for further schema documentation:
|
|
4148
|
+
*
|
|
4149
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4150
|
+
*
|
|
4151
|
+
* **Composition and Inheritance (Polymorphism)**
|
|
4152
|
+
*
|
|
4153
|
+
* TODO: content, examples
|
|
4154
|
+
*/
|
|
4155
|
+
interface SchemaObject extends EnumExtensions {
|
|
4156
|
+
/**
|
|
4157
|
+
* The value of "additionalProperties" MUST be a boolean or a schema.
|
|
4158
|
+
*
|
|
4159
|
+
* If "additionalProperties" is absent, it may be considered present with an empty schema as a value.
|
|
4160
|
+
*
|
|
4161
|
+
* If "additionalProperties" is true, validation always succeeds.
|
|
4162
|
+
*
|
|
4163
|
+
* If "additionalProperties" is false, validation succeeds only if the instance is an object and all properties on the instance were covered by "properties" and/or "patternProperties".
|
|
4164
|
+
*
|
|
4165
|
+
* If "additionalProperties" is an object, validate the value as a schema to all of the properties that weren't validated by "properties" nor "patternProperties".
|
|
4166
|
+
*
|
|
4167
|
+
* Value can be boolean or object. Inline or referenced schema MUST be of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} and not a standard JSON Schema. Consistent with JSON Schema, `additionalProperties` defaults to `true`.
|
|
4168
|
+
*/
|
|
4169
|
+
additionalProperties?: boolean | SchemaObject | ReferenceObject;
|
|
4170
|
+
/**
|
|
4171
|
+
* This keyword's value MUST be an array. This array MUST have at least one element.
|
|
4172
|
+
*
|
|
4173
|
+
* Elements of the array MUST be objects. Each object MUST be a valid Schema Object.
|
|
4174
|
+
*
|
|
4175
|
+
* An instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword's value.
|
|
4176
|
+
*/
|
|
4177
|
+
allOf?: ReadonlyArray<SchemaObject | ReferenceObject>;
|
|
4178
|
+
/**
|
|
4179
|
+
* This keyword's value MUST be an array. This array MUST have at least one element.
|
|
4180
|
+
*
|
|
4181
|
+
* Elements of the array MUST be objects. Each object MUST be a valid Schema Object.
|
|
4182
|
+
*
|
|
4183
|
+
* An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this
|
|
4184
|
+
keyword's value.
|
|
4185
|
+
*/
|
|
4186
|
+
anyOf?: ReadonlyArray<SchemaObject | ReferenceObject>;
|
|
4187
|
+
/**
|
|
4188
|
+
* The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined `type` for the Schema Object defined at the same level. For example, if `type` is `"string"`, then `default` can be `"foo"` but cannot be `1`.
|
|
4189
|
+
*/
|
|
4190
|
+
default?: unknown;
|
|
4191
|
+
/**
|
|
4192
|
+
* Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
|
|
4193
|
+
*/
|
|
4194
|
+
deprecated?: boolean;
|
|
4195
|
+
/**
|
|
4196
|
+
* The value of both of these keywords MUST be a string.
|
|
4197
|
+
*
|
|
4198
|
+
* Both of these keywords can be used to decorate a user interface with information about the data produced by this user interface. A title will preferrably be short, whereas a description will provide explanation about the purpose of the instance described by this schema.
|
|
4199
|
+
*
|
|
4200
|
+
* Both of these keywords MAY be used in root schemas, and in any subschemas.
|
|
4201
|
+
*/
|
|
4202
|
+
description?: string;
|
|
4203
|
+
/**
|
|
4204
|
+
* Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#composition-and-inheritance-polymorphism Composition and Inheritance} for more details.
|
|
4205
|
+
*/
|
|
4206
|
+
discriminator?: DiscriminatorObject;
|
|
4207
|
+
/**
|
|
4208
|
+
* The value of this keyword MUST be an array. This array SHOULD have at least one element. Elements in the array SHOULD be unique.
|
|
4209
|
+
*
|
|
4210
|
+
* Elements in the array MAY be of any type, including null.
|
|
4211
|
+
*
|
|
4212
|
+
* An instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value.
|
|
4213
|
+
*/
|
|
4214
|
+
enum?: ReadonlyArray<unknown>;
|
|
4215
|
+
/**
|
|
4216
|
+
* A free-form field to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
|
|
4217
|
+
*/
|
|
4218
|
+
example?: unknown;
|
|
4219
|
+
/**
|
|
4220
|
+
* The value of "exclusiveMaximum" MUST be a boolean, representing whether the limit in "maximum" is exclusive or not. An undefined value is the same as false.
|
|
4221
|
+
*
|
|
4222
|
+
* If "exclusiveMaximum" is true, then a numeric instance SHOULD NOT be equal to the value specified in "maximum". If "exclusiveMaximum" is false (or not specified), then a numeric instance MAY be equal to the value of "maximum".
|
|
4223
|
+
*/
|
|
4224
|
+
exclusiveMaximum?: boolean;
|
|
4225
|
+
/**
|
|
4226
|
+
* The value of "exclusiveMinimum" MUST be a boolean, representing whether the limit in "minimum" is exclusive or not. An undefined value is the same as false.
|
|
4227
|
+
*
|
|
4228
|
+
* If "exclusiveMinimum" is true, then a numeric instance SHOULD NOT be equal to the value specified in "minimum". If "exclusiveMinimum" is false (or not specified), then a numeric instance MAY be equal to the value of "minimum".
|
|
4229
|
+
*/
|
|
4230
|
+
exclusiveMinimum?: boolean;
|
|
4231
|
+
/**
|
|
4232
|
+
* Additional external documentation for this schema.
|
|
4233
|
+
*/
|
|
4234
|
+
externalDocs?: ExternalDocumentationObject;
|
|
4235
|
+
/**
|
|
4236
|
+
* While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.
|
|
4237
|
+
*/
|
|
4238
|
+
format?: Format;
|
|
4239
|
+
/**
|
|
4240
|
+
* `items` MUST be present if `type` is `"array"`.
|
|
4241
|
+
*/
|
|
4242
|
+
items?: SchemaObject | ReferenceObject;
|
|
4243
|
+
/**
|
|
4244
|
+
* The value of this keyword MUST be an integer. This integer MUST be greater than, or equal to, 0.
|
|
4245
|
+
*
|
|
4246
|
+
* An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
|
|
4247
|
+
*/
|
|
4248
|
+
maxItems?: number;
|
|
4249
|
+
/**
|
|
4250
|
+
* The value of this keyword MUST be a non-negative integer.
|
|
4251
|
+
*
|
|
4252
|
+
* The value of this keyword MUST be an integer. This integer MUST be greater than, or equal to, 0.
|
|
4253
|
+
*
|
|
4254
|
+
* A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
|
|
4255
|
+
*
|
|
4256
|
+
* The length of a string instance is defined as the number of its characters as defined by {@link https://datatracker.ietf.org/doc/html/rfc7159 RFC 7159} [RFC7159].
|
|
4257
|
+
*/
|
|
4258
|
+
maxLength?: number;
|
|
4259
|
+
/**
|
|
4260
|
+
* The value of this keyword MUST be an integer. This integer MUST be greater than, or equal to, 0.
|
|
4261
|
+
*
|
|
4262
|
+
* An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.
|
|
4263
|
+
*/
|
|
4264
|
+
maxProperties?: number;
|
|
4265
|
+
/**
|
|
4266
|
+
* The value of "maximum" MUST be a number, representing an upper limit for a numeric instance.
|
|
4267
|
+
*
|
|
4268
|
+
* If the instance is a number, then this keyword validates if "exclusiveMaximum" is true and instance is less than the provided value, or else if the instance is less than or exactly equal to the provided value.
|
|
4269
|
+
*/
|
|
4270
|
+
maximum?: number;
|
|
4271
|
+
/**
|
|
4272
|
+
* The value of this keyword MUST be an integer. This integer MUST be greater than, or equal to, 0.
|
|
4273
|
+
*
|
|
4274
|
+
* An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword.
|
|
4275
|
+
*
|
|
4276
|
+
* If this keyword is not present, it may be considered present with a value of 0.
|
|
4277
|
+
*/
|
|
4278
|
+
minItems?: number;
|
|
4279
|
+
/**
|
|
4280
|
+
* A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
|
|
4281
|
+
*
|
|
4282
|
+
* The length of a string instance is defined as the number of its characters as defined by {@link https://datatracker.ietf.org/doc/html/rfc7159 RFC 7159} [RFC7159].
|
|
4283
|
+
*
|
|
4284
|
+
* The value of this keyword MUST be an integer. This integer MUST be greater than, or equal to, 0.
|
|
4285
|
+
*
|
|
4286
|
+
* "minLength", if absent, may be considered as being present with integer value 0.
|
|
4287
|
+
*/
|
|
4288
|
+
minLength?: number;
|
|
4289
|
+
/**
|
|
4290
|
+
* The value of this keyword MUST be an integer. This integer MUST be greater than, or equal to, 0.
|
|
4291
|
+
*
|
|
4292
|
+
* An object instance is valid against "minProperties" if its number of properties is greater than, or equal to, the value of this keyword.
|
|
4293
|
+
*
|
|
4294
|
+
* If this keyword is not present, it may be considered present with a value of 0.
|
|
4295
|
+
*/
|
|
4296
|
+
minProperties?: number;
|
|
4297
|
+
/**
|
|
4298
|
+
* The value of "minimum" MUST be a number, representing a lower limit for a numeric instance.
|
|
4299
|
+
*
|
|
4300
|
+
* If the instance is a number, then this keyword validates if "exclusiveMinimum" is true and instance is greater than the provided value, or else if the instance is greater than or exactly equal to the provided value.
|
|
4301
|
+
*/
|
|
4302
|
+
minimum?: number;
|
|
4303
|
+
/**
|
|
4304
|
+
* The value of "multipleOf" MUST be a number, strictly greater than 0.
|
|
4305
|
+
*
|
|
4306
|
+
* A numeric instance is only valid if division by this keyword's value results in an integer.
|
|
4307
|
+
*/
|
|
4308
|
+
multipleOf?: number;
|
|
4309
|
+
/**
|
|
4310
|
+
* This keyword's value MUST be an object. This object MUST be a valid Schema Object.
|
|
4311
|
+
*
|
|
4312
|
+
* An instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword.
|
|
4313
|
+
*/
|
|
4314
|
+
not?: SchemaObject | ReferenceObject;
|
|
4315
|
+
/**
|
|
4316
|
+
* This keyword only takes effect if `type` is explicitly defined within the same Schema Object. A `true` value indicates that both `null` values and values of the type specified by `type` are allowed. Other Schema Object constraints retain their defined behavior, and therefore may disallow the use of `null` as a value. A `false` value leaves the specified or default `type` unmodified. The default value is `false`.
|
|
4317
|
+
*/
|
|
4318
|
+
nullable?: boolean;
|
|
4319
|
+
/**
|
|
4320
|
+
* This keyword's value MUST be an array. This array MUST have at least one element.
|
|
4321
|
+
*
|
|
4322
|
+
* Elements of the array MUST be objects. Each object MUST be a valid Schema Object.
|
|
4323
|
+
*
|
|
4324
|
+
* An instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword's value.
|
|
4325
|
+
*/
|
|
4326
|
+
oneOf?: ReadonlyArray<SchemaObject | ReferenceObject>;
|
|
4327
|
+
/**
|
|
4328
|
+
* The value of this keyword MUST be a string. This string SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect.
|
|
4329
|
+
*
|
|
4330
|
+
* A string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.
|
|
4331
|
+
*/
|
|
4332
|
+
pattern?: string;
|
|
4333
|
+
/**
|
|
4334
|
+
* The value of "properties" MUST be an object. Each value of this object MUST be an object, and each object MUST be a valid Schema Object.
|
|
4335
|
+
*
|
|
4336
|
+
* If absent, it can be considered the same as an empty object.
|
|
4337
|
+
*/
|
|
4338
|
+
properties?: Record<string, SchemaObject | ReferenceObject>;
|
|
4339
|
+
/**
|
|
4340
|
+
* Relevant only for Schema Object `properties` definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but SHOULD NOT be sent as part of the request. If the property is marked as `readOnly` being `true` and is in the `required` list, the `required` will take effect on the response only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
|
|
4341
|
+
*/
|
|
4342
|
+
readOnly?: boolean;
|
|
4343
|
+
/**
|
|
4344
|
+
* The value of this keyword MUST be an array. This array MUST have at least one element. Elements of this array MUST be strings, and MUST be unique.
|
|
4345
|
+
*
|
|
4346
|
+
* An object instance is valid against this keyword if its property set contains all elements in this keyword's array value.
|
|
4347
|
+
*/
|
|
4348
|
+
required?: ReadonlyArray<string>;
|
|
4349
|
+
/**
|
|
4350
|
+
* The value of both of these keywords MUST be a string.
|
|
4351
|
+
*
|
|
4352
|
+
* Both of these keywords can be used to decorate a user interface with information about the data produced by this user interface. A title will preferrably be short, whereas a description will provide explanation about the purpose of the instance described by this schema.
|
|
4353
|
+
*
|
|
4354
|
+
* Both of these keywords MAY be used in root schemas, and in any subschemas.
|
|
4355
|
+
*/
|
|
4356
|
+
title?: string;
|
|
4357
|
+
/**
|
|
4358
|
+
* The value of this keyword MUST be a string.
|
|
4359
|
+
*
|
|
4360
|
+
* An instance matches successfully if its primitive type is one of the types defined by keyword. Recall: "number" includes "integer".
|
|
4361
|
+
*/
|
|
4362
|
+
type?: 'array' | 'boolean' | 'integer' | 'number' | 'object' | 'string';
|
|
4363
|
+
/**
|
|
4364
|
+
* The value of this keyword MUST be a boolean.
|
|
4365
|
+
*
|
|
4366
|
+
* If this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.
|
|
4367
|
+
*
|
|
4368
|
+
* If not present, this keyword may be considered present with boolean value false.
|
|
4369
|
+
*/
|
|
4370
|
+
uniqueItems?: boolean;
|
|
4371
|
+
/**
|
|
4372
|
+
* Relevant only for Schema Object `properties` definitions. Declares the property as "write only". Therefore, it MAY be sent as part of a request but SHOULD NOT be sent as part of the response. If the property is marked as `writeOnly` being `true` and is in the `required` list, the `required` will take effect on the request only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
|
|
4373
|
+
*/
|
|
4374
|
+
writeOnly?: boolean;
|
|
4375
|
+
/**
|
|
4376
|
+
* This MAY be used only on property schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
|
|
4377
|
+
*/
|
|
4378
|
+
xml?: XMLObject;
|
|
4379
|
+
}
|
|
4380
|
+
|
|
4381
|
+
/**
|
|
4382
|
+
* Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#security-scheme-object Security Schemes} under the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-object Components Object}.
|
|
4383
|
+
*
|
|
4384
|
+
* A Security Requirement Object MAY refer to multiple security schemes in which case all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
|
|
4385
|
+
*
|
|
4386
|
+
* When the `security` field is defined on the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#openapi-object OpenAPI Object} or {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#operation-object Operation Object} and contains multiple Security Requirement Objects, only one of the entries in the list needs to be satisfied to authorize the request. This enables support for scenarios where the API allows multiple, independent security schemes.
|
|
4387
|
+
*
|
|
4388
|
+
* An empty Security Requirement Object (`{}`) indicates anonymous access is supported.
|
|
4389
|
+
*
|
|
4390
|
+
* TODO: examples
|
|
4391
|
+
*/
|
|
4392
|
+
interface SecurityRequirementObject {
|
|
4393
|
+
/**
|
|
4394
|
+
* Each name MUST correspond to a security scheme which is declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#security-scheme-object Security Schemes} under the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-object Components Object}. If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MUST be empty.
|
|
4395
|
+
*/
|
|
4396
|
+
[name: string]: ReadonlyArray<string>;
|
|
4397
|
+
}
|
|
4398
|
+
|
|
4399
|
+
/**
|
|
4400
|
+
* Defines a security scheme that can be used by the operations.
|
|
4401
|
+
*
|
|
4402
|
+
* Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter, or as a query parameter), OAuth2's common flows (implicit, password, client credentials, and authorization code) as defined in {@link https://tools.ietf.org/html/rfc6749 RFC6749}, and [[OpenID-Connect-Core]]. Please note that as of 2020, the implicit flow is about to be deprecated by {@link https://tools.ietf.org/html/draft-ietf-oauth-security-topics OAuth 2.0 Security Best Current Practice}. Recommended for most use cases is Authorization Code Grant flow with PKCE.
|
|
4403
|
+
*
|
|
4404
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4405
|
+
*
|
|
4406
|
+
* TODO: examples
|
|
4407
|
+
*/
|
|
4408
|
+
type SecuritySchemeObject = {
|
|
4409
|
+
/**
|
|
4410
|
+
* A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
4411
|
+
*/
|
|
4412
|
+
description?: string;
|
|
4413
|
+
} & (
|
|
4414
|
+
| {
|
|
4415
|
+
/**
|
|
4416
|
+
* **REQUIRED**. The location of the API key. Valid values are `"query"`, `"header"`, or `"cookie"`.
|
|
4417
|
+
*/
|
|
4418
|
+
in: 'cookie' | 'header' | 'query';
|
|
4419
|
+
/**
|
|
4420
|
+
* **REQUIRED**. The name of the header, query or cookie parameter to be used.
|
|
4421
|
+
*/
|
|
4422
|
+
name: string;
|
|
4423
|
+
/**
|
|
4424
|
+
* **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
|
|
4425
|
+
*/
|
|
4426
|
+
type: 'apiKey';
|
|
4427
|
+
}
|
|
4428
|
+
| {
|
|
4429
|
+
/**
|
|
4430
|
+
* A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
|
|
4431
|
+
*/
|
|
4432
|
+
bearerFormat?: string;
|
|
4433
|
+
/**
|
|
4434
|
+
* **REQUIRED**. The name of the HTTP Authentication scheme to be used in the {@link https://tools.ietf.org/html/rfc7235#section-5.1 Authorization header as defined in RFC7235}. The values used SHOULD be registered in the {@link https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml IANA Authentication Scheme registry}. The value is case-insensitive, as defined in {@link https://datatracker.ietf.org/doc/html/rfc7235#section-2.1 RFC7235}.
|
|
4435
|
+
*/
|
|
4436
|
+
scheme: string;
|
|
4437
|
+
/**
|
|
4438
|
+
* **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
|
|
4439
|
+
*/
|
|
4440
|
+
type: 'http';
|
|
4441
|
+
}
|
|
4442
|
+
| {
|
|
4443
|
+
/**
|
|
4444
|
+
* **REQUIRED**. An object containing configuration information for the flow types supported.
|
|
4445
|
+
*/
|
|
4446
|
+
flows: OAuthFlowsObject;
|
|
4447
|
+
/**
|
|
4448
|
+
* **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
|
|
4449
|
+
*/
|
|
4450
|
+
type: 'oauth2';
|
|
4451
|
+
}
|
|
4452
|
+
| {
|
|
4453
|
+
/**
|
|
4454
|
+
* **REQUIRED**. {@link https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig Well-known URL} to discover the [[OpenID-Connect-Discovery]] {@link https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata provider metadata}.
|
|
4455
|
+
*/
|
|
4456
|
+
openIdConnectUrl: string;
|
|
4457
|
+
/**
|
|
4458
|
+
* **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
|
|
4459
|
+
*/
|
|
4460
|
+
type: 'openIdConnect';
|
|
4461
|
+
}
|
|
4462
|
+
);
|
|
4463
|
+
|
|
4464
|
+
/**
|
|
4465
|
+
* An object representing a Server.
|
|
4466
|
+
*
|
|
4467
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4468
|
+
*
|
|
4469
|
+
* TODO: examples
|
|
4470
|
+
*/
|
|
4471
|
+
interface ServerObject {
|
|
4472
|
+
/**
|
|
4473
|
+
* An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
4474
|
+
*/
|
|
4475
|
+
description?: string;
|
|
4476
|
+
/**
|
|
4477
|
+
* **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the document containing the Server Object is being served. Variable substitutions will be made when a variable is named in `{`braces`}`.
|
|
4478
|
+
*/
|
|
4479
|
+
url: string;
|
|
4480
|
+
/**
|
|
4481
|
+
* A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
|
4482
|
+
*/
|
|
4483
|
+
variables?: Record<string, ServerVariableObject>;
|
|
4484
|
+
}
|
|
4485
|
+
|
|
4486
|
+
/**
|
|
4487
|
+
* An object representing a Server Variable for server URL template substitution.
|
|
4488
|
+
*
|
|
4489
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4490
|
+
*/
|
|
4491
|
+
interface ServerVariableObject {
|
|
4492
|
+
/**
|
|
4493
|
+
* **REQUIRED**. The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. If the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server-variable-enum `enum`} is defined, the value SHOULD exist in the enum's values. Note that this behavior is different from the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object}'s `default` keyword, which documents the receiver's behavior rather than inserting the value into the data.
|
|
4494
|
+
*/
|
|
4495
|
+
default: string;
|
|
4496
|
+
/**
|
|
4497
|
+
* An optional description for the server variable. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
4498
|
+
*/
|
|
4499
|
+
description?: string;
|
|
4500
|
+
/**
|
|
4501
|
+
* An enumeration of string values to be used if the substitution options are from a limited set. The array SHOULD NOT be empty.
|
|
4502
|
+
*/
|
|
4503
|
+
enum?: ReadonlyArray<string>;
|
|
4504
|
+
}
|
|
4505
|
+
|
|
4506
|
+
/**
|
|
4507
|
+
* Adds metadata to a single tag that is used by the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#operation-object Operation Object}. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
|
|
4508
|
+
*
|
|
4509
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4510
|
+
*
|
|
4511
|
+
* **Tag Object Example**
|
|
4512
|
+
*
|
|
4513
|
+
* ```yaml
|
|
4514
|
+
* name: pet
|
|
4515
|
+
* description: Pets operations
|
|
4516
|
+
* ```
|
|
4517
|
+
*/
|
|
4518
|
+
interface TagObject {
|
|
4519
|
+
/**
|
|
4520
|
+
* A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
|
|
4521
|
+
*/
|
|
4522
|
+
description?: string;
|
|
4523
|
+
/**
|
|
4524
|
+
* Additional external documentation for this tag.
|
|
4525
|
+
*/
|
|
4526
|
+
externalDocs?: ExternalDocumentationObject;
|
|
4527
|
+
/**
|
|
4528
|
+
* **REQUIRED**. The name of the tag.
|
|
4529
|
+
*/
|
|
4530
|
+
name: string;
|
|
4531
|
+
}
|
|
4532
|
+
|
|
4533
|
+
/**
|
|
4534
|
+
* A metadata object that allows for more fine-tuned XML model definitions.
|
|
4535
|
+
*
|
|
4536
|
+
* When using arrays, XML element names are _not_ inferred (for singular/plural forms) and the `name` field SHOULD be used to add that information. See examples for expected behavior.
|
|
4537
|
+
*
|
|
4538
|
+
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
|
|
4539
|
+
*
|
|
4540
|
+
* The `namespace` field is intended to match the syntax of {@link https://www.w3.org/TR/xml-names11/ XML namespaces}, although there are a few caveats:
|
|
4541
|
+
* - Version 3.0.3 and earlier of this specification erroneously used the term "absolute URI" instead of "non-relative URI", so authors using namespaces that include a fragment should check tooling support carefully.
|
|
4542
|
+
* - XML allows but discourages relative URI-references, while this specification outright forbids them.
|
|
4543
|
+
* - XML 1.1 allows IRIs ({@link https://datatracker.ietf.org/doc/html/rfc3987 RFC3987}) as namespaces, and specifies that namespaces are compared without any encoding or decoding, which means that IRIs encoded to meet this specification's URI syntax requirement cannot be compared to IRIs as-is.
|
|
4544
|
+
*
|
|
4545
|
+
* TODO: examples
|
|
4546
|
+
*/
|
|
4547
|
+
interface XMLObject {
|
|
4548
|
+
/**
|
|
4549
|
+
* Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
|
|
4550
|
+
*/
|
|
4551
|
+
attribute?: boolean;
|
|
4552
|
+
/**
|
|
4553
|
+
* Replaces the name of the element/attribute used for the described schema property. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `"array"` (outside the `items`), it will affect the wrapping element if and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored.
|
|
4554
|
+
*/
|
|
4555
|
+
name?: string;
|
|
4556
|
+
/**
|
|
4557
|
+
* The URI of the namespace definition. Value MUST be in the form of a non-relative URI.
|
|
4558
|
+
*/
|
|
4559
|
+
namespace?: string;
|
|
4560
|
+
/**
|
|
4561
|
+
* The prefix to be used for the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#xml-name name}.
|
|
4562
|
+
*/
|
|
4563
|
+
prefix?: string;
|
|
4564
|
+
/**
|
|
4565
|
+
* MAY be used only for an array definition. Signifies whether the array is wrapped (for example, `<books><book/><book/></books>`) or unwrapped (`<book/><book/>`). Default value is `false`. The definition takes effect only when defined alongside `type` being `"array"` (outside the `items`).
|
|
4566
|
+
*/
|
|
4567
|
+
wrapped?: boolean;
|
|
4568
|
+
}
|
|
4569
|
+
|
|
4570
|
+
type JsonSchemaFormats =
|
|
4571
|
+
| 'date-time'
|
|
4572
|
+
| 'email'
|
|
4573
|
+
| 'hostname'
|
|
4574
|
+
| 'ipv4'
|
|
4575
|
+
| 'ipv6'
|
|
4576
|
+
| 'uri'
|
|
4577
|
+
| 'uriref';
|
|
4578
|
+
|
|
4579
|
+
type OpenApiSchemaFormats =
|
|
4580
|
+
| 'int32'
|
|
4581
|
+
| 'int64'
|
|
4582
|
+
| 'float'
|
|
4583
|
+
| 'double'
|
|
4584
|
+
| 'byte'
|
|
4585
|
+
| 'binary'
|
|
4586
|
+
| 'date'
|
|
4587
|
+
| 'date-time'
|
|
4588
|
+
| 'password';
|
|
4589
|
+
|
|
4590
|
+
type Format =
|
|
4591
|
+
| JsonSchemaFormats
|
|
4592
|
+
| OpenApiSchemaFormats
|
|
4593
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
4594
|
+
| (string & {});
|
|
3323
4595
|
|
|
3324
4596
|
/**
|
|
3325
4597
|
* Generate the OpenAPI client. This method will read the OpenAPI specification and based on the
|
|
@@ -3337,4 +4609,4 @@ declare const _default: {
|
|
|
3337
4609
|
defineConfig: (config: UserConfig) => UserConfig;
|
|
3338
4610
|
};
|
|
3339
4611
|
|
|
3340
|
-
export { type
|
|
4612
|
+
export { type OpenApiV3_0_X, type OpenApiV3_1_X, type UserConfig, createClient, _default as default, defineConfig };
|