fork of hey-api/openapi-ts because I need some additional things

refactor: Extract SpecificationExtensions type and apply to all spec interfaces

- Created SpecificationExtensions interface in 3.0.x and 3.1.x spec.d.ts
- Applied to all 27 interfaces that support extensions in each version
- Replaced inline `[extension: x-${string}]: unknown` with extends clause
- Also added SpecificationExtensions to JsonSchemaDraft2020_12

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>

Changed files
+179 -161
packages
openapi-ts
src
openApi
+82 -77
packages/openapi-ts/src/openApi/3.0.x/types/spec.d.ts
··· 1 1 import type { EnumExtensions } from '~/openApi/shared/types/openapi-spec-extensions'; 2 2 3 3 /** 4 + * Type for OpenAPI Specification Extensions (x-* fields). 5 + * See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}. 6 + */ 7 + export interface SpecificationExtensions { 8 + [extension: `x-${string}`]: unknown; 9 + } 10 + 11 + /** 4 12 * This is the root object of the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#openapi-description OpenAPI Description}. 5 13 * 6 14 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}. 7 15 */ 8 - export interface OpenApiV3_0_X { 16 + export interface OpenApiV3_0_X extends SpecificationExtensions { 9 17 /** 10 18 * An element to hold various Objects for the OpenAPI Description. 11 19 */ ··· 47 55 * 48 56 * TODO: examples 49 57 */ 50 - export interface CallbackObject { 58 + export interface CallbackObject extends SpecificationExtensions { 51 59 /** 52 60 * 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. 53 61 */ ··· 63 71 * 64 72 * TODO: examples 65 73 */ 66 - export interface ComponentsObject { 74 + export interface ComponentsObject extends SpecificationExtensions { 67 75 /** 68 76 * An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#callback-object Callback Objects}. 69 77 */ ··· 113 121 * email: support@example.com 114 122 * ``` 115 123 */ 116 - export interface ContactObject { 124 + export interface ContactObject extends SpecificationExtensions { 117 125 /** 118 126 * The email address of the contact person/organization. This MUST be in the form of an email address. 119 127 */ ··· 160 168 * TODO: default values examples 161 169 * TODO: examples 162 170 */ 163 - export interface EncodingObject { 171 + export interface EncodingObject extends SpecificationExtensions { 164 172 /** 165 173 * 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`. 166 174 */ ··· 201 209 * 202 210 * TODO: examples 203 211 */ 204 - export interface ExampleObject { 212 + export interface ExampleObject extends SpecificationExtensions { 205 213 /** 206 214 * Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 207 215 */ ··· 232 240 * url: https://example.com 233 241 * ``` 234 242 */ 235 - export interface ExternalDocumentationObject { 243 + export interface ExternalDocumentationObject extends SpecificationExtensions { 236 244 /** 237 245 * A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 238 246 */ ··· 313 321 * url: https://www.apache.org/licenses/LICENSE-2.0.html 314 322 * ``` 315 323 */ 316 - export interface LicenseObject { 324 + export interface LicenseObject extends SpecificationExtensions { 317 325 /** 318 326 * **REQUIRED**. The license name used for the API. 319 327 */ ··· 339 347 * 340 348 * TODO: examples 341 349 */ 342 - export interface LinkObject { 350 + export interface LinkObject extends SpecificationExtensions { 343 351 /** 344 352 * A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 345 353 */ ··· 375 383 * 376 384 * TODO: examples 377 385 */ 378 - export interface MediaTypeObject { 386 + export interface MediaTypeObject extends SpecificationExtensions { 379 387 /** 380 388 * 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. 381 389 */ ··· 401 409 * 402 410 * TODO: examples 403 411 */ 404 - export interface OAuthFlowObject { 412 + export interface OAuthFlowObject extends SpecificationExtensions { 405 413 /** 406 414 * **REQUIRED (`"implicit"`, `"authorizationCode"`)**. 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. 407 415 */ ··· 425 433 * 426 434 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}. 427 435 */ 428 - export interface OAuthFlowsObject { 436 + export interface OAuthFlowsObject extends SpecificationExtensions { 429 437 /** 430 438 * Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0. 431 439 */ ··· 451 459 * 452 460 * TODO: examples 453 461 */ 454 - export interface OperationObject { 455 - [extension: `x-${string}`]: unknown; 462 + export interface OperationObject extends SpecificationExtensions { 456 463 /** 457 464 * 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. 458 465 */ ··· 547 554 * 548 555 * TODO: examples 549 556 */ 550 - export interface ParameterObject { 551 - [extension: `x-${string}`]: unknown; 557 + export interface ParameterObject extends SpecificationExtensions { 552 558 /** 553 559 * 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. 554 560 */ ··· 620 626 * 621 627 * TODO: examples 622 628 */ 623 - export interface PathItemObject { 629 + export interface PathItemObject extends SpecificationExtensions { 624 630 /** 625 631 * 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}. 626 632 */ ··· 682 688 * 683 689 * TODO: examples 684 690 */ 685 - export interface PathsObject { 691 + export interface PathsObject extends SpecificationExtensions { 686 692 /** 687 693 * 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. 688 694 */ ··· 730 736 * 731 737 * TODO: examples 732 738 */ 733 - export interface RequestBodyObject { 739 + export interface RequestBodyObject extends SpecificationExtensions { 734 740 /** 735 741 * **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/*"` 736 742 */ ··· 752 758 * 753 759 * TODO: examples 754 760 */ 755 - export interface ResponseObject { 761 + export interface ResponseObject extends SpecificationExtensions { 756 762 /** 757 763 * 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/*"` 758 764 */ ··· 784 790 * 785 791 * TODO: examples 786 792 */ 787 - export interface ResponsesObject { 793 + export interface ResponsesObject extends SpecificationExtensions { 788 794 /** 789 795 * 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. 790 796 */ ··· 846 852 * 847 853 * TODO: content, examples 848 854 */ 849 - export interface SchemaObject extends EnumExtensions { 850 - [extension: `x-${string}`]: unknown; 855 + export interface SchemaObject extends EnumExtensions, SpecificationExtensions { 851 856 /** 852 857 * The value of "additionalProperties" MUST be a boolean or a schema. 853 858 * ··· 1100 1105 * 1101 1106 * TODO: examples 1102 1107 */ 1103 - export type SecuritySchemeObject = { 1108 + export type SecuritySchemeObject = SpecificationExtensions & { 1104 1109 /** 1105 1110 * A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 1106 1111 */ 1107 1112 description?: string; 1108 1113 } & ( 1109 - | { 1110 - /** 1111 - * **REQUIRED**. The location of the API key. Valid values are `"query"`, `"header"`, or `"cookie"`. 1112 - */ 1113 - in: 'cookie' | 'header' | 'query'; 1114 - /** 1115 - * **REQUIRED**. The name of the header, query or cookie parameter to be used. 1116 - */ 1117 - name: string; 1118 - /** 1119 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. 1120 - */ 1121 - type: 'apiKey'; 1122 - } 1123 - | { 1124 - /** 1125 - * 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. 1126 - */ 1127 - bearerFormat?: string; 1128 - /** 1129 - * **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}. 1130 - */ 1131 - scheme: string; 1132 - /** 1133 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. 1134 - */ 1135 - type: 'http'; 1136 - } 1137 - | { 1138 - /** 1139 - * **REQUIRED**. An object containing configuration information for the flow types supported. 1140 - */ 1141 - flows: OAuthFlowsObject; 1142 - /** 1143 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. 1144 - */ 1145 - type: 'oauth2'; 1146 - } 1147 - | { 1148 - /** 1149 - * **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}. 1150 - */ 1151 - openIdConnectUrl: string; 1152 - /** 1153 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. 1154 - */ 1155 - type: 'openIdConnect'; 1156 - } 1157 - ); 1114 + | { 1115 + /** 1116 + * **REQUIRED**. The location of the API key. Valid values are `"query"`, `"header"`, or `"cookie"`. 1117 + */ 1118 + in: 'cookie' | 'header' | 'query'; 1119 + /** 1120 + * **REQUIRED**. The name of the header, query or cookie parameter to be used. 1121 + */ 1122 + name: string; 1123 + /** 1124 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. 1125 + */ 1126 + type: 'apiKey'; 1127 + } 1128 + | { 1129 + /** 1130 + * 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. 1131 + */ 1132 + bearerFormat?: string; 1133 + /** 1134 + * **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}. 1135 + */ 1136 + scheme: string; 1137 + /** 1138 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. 1139 + */ 1140 + type: 'http'; 1141 + } 1142 + | { 1143 + /** 1144 + * **REQUIRED**. An object containing configuration information for the flow types supported. 1145 + */ 1146 + flows: OAuthFlowsObject; 1147 + /** 1148 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. 1149 + */ 1150 + type: 'oauth2'; 1151 + } 1152 + | { 1153 + /** 1154 + * **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}. 1155 + */ 1156 + openIdConnectUrl: string; 1157 + /** 1158 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. 1159 + */ 1160 + type: 'openIdConnect'; 1161 + } 1162 + ); 1158 1163 1159 1164 /** 1160 1165 * An object representing a Server. ··· 1163 1168 * 1164 1169 * TODO: examples 1165 1170 */ 1166 - export interface ServerObject { 1171 + export interface ServerObject extends SpecificationExtensions { 1167 1172 /** 1168 1173 * An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 1169 1174 */ ··· 1183 1188 * 1184 1189 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}. 1185 1190 */ 1186 - export interface ServerVariableObject { 1191 + export interface ServerVariableObject extends SpecificationExtensions { 1187 1192 /** 1188 1193 * **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. 1189 1194 */ ··· 1210 1215 * description: Pets operations 1211 1216 * ``` 1212 1217 */ 1213 - export interface TagObject { 1218 + export interface TagObject extends SpecificationExtensions { 1214 1219 /** 1215 1220 * A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 1216 1221 */ ··· 1239 1244 * 1240 1245 * TODO: examples 1241 1246 */ 1242 - export interface XMLObject { 1247 + export interface XMLObject extends SpecificationExtensions { 1243 1248 /** 1244 1249 * Declares whether the property definition translates to an attribute instead of an element. Default value is `false`. 1245 1250 */
+9 -2
packages/openapi-ts/src/openApi/3.1.x/types/json-schema-draft-2020-12.d.ts
··· 3 3 import type { MaybeArray } from '../../../types/utils'; 4 4 import type { OpenApiSchemaExtensions } from './spec-extensions'; 5 5 6 + /** 7 + * Type for OpenAPI Specification Extensions (x-* fields). 8 + */ 9 + export interface SpecificationExtensions { 10 + [extension: `x-${string}`]: unknown; 11 + } 12 + 6 13 // TODO: left out some keywords related to structuring a complex schema and declaring a dialect 7 14 export interface JsonSchemaDraft2020_12 8 15 extends ArrayKeywords, ··· 10 17 ObjectKeywords, 11 18 StringKeywords, 12 19 EnumExtensions, 13 - OpenApiSchemaExtensions { 14 - [extension: `x-${string}`]: unknown; 20 + OpenApiSchemaExtensions, 21 + SpecificationExtensions { 15 22 /** 16 23 * The `$comment` {@link https://json-schema.org/learn/glossary#keyword keyword} is strictly intended for adding comments to a schema. Its value must always be a string. Unlike the annotations `title`, `description`, and `examples`, JSON schema {@link https://json-schema.org/learn/glossary#implementation implementations} aren't allowed to attach any meaning or behavior to it whatsoever, and may even strip them at any time. Therefore, they are useful for leaving notes to future editors of a JSON schema, but should not be used to communicate to users of the schema. 17 24 */
+88 -82
packages/openapi-ts/src/openApi/3.1.x/types/spec.d.ts
··· 1 1 import type { JsonSchemaDraft2020_12 } from './json-schema-draft-2020-12'; 2 2 3 3 /** 4 + * Type for OpenAPI Specification Extensions (x-* fields). 5 + * See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}. 6 + */ 7 + export interface SpecificationExtensions { 8 + [extension: `x-${string}`]: unknown; 9 + } 10 + 11 + /** 4 12 * This is the root object of the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-document OpenAPI document}. 5 13 * 6 14 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}. 7 15 */ 8 - export interface OpenApiV3_1_X { 16 + export interface OpenApiV3_1_X extends SpecificationExtensions { 9 17 /** 10 18 * An element to hold various schemas for the document. 11 19 */ ··· 129 137 * description: callback successfully processed 130 138 * ``` 131 139 */ 132 - export interface CallbackObject { 140 + export interface CallbackObject extends SpecificationExtensions { 133 141 /** 134 142 * 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. 135 143 */ ··· 225 233 * read:pets: read your pets 226 234 * ``` 227 235 */ 228 - export interface ComponentsObject { 236 + export interface ComponentsObject extends SpecificationExtensions { 229 237 /** 230 238 * An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object Callback Objects}. 231 239 */ ··· 280 288 * email: support@example.com 281 289 * ``` 282 290 */ 283 - export interface ContactObject { 291 + export interface ContactObject extends SpecificationExtensions { 284 292 /** 285 293 * The email address of the contact person/organization. This MUST be in the form of an email address. 286 294 */ ··· 473 481 * type: integer 474 482 * ``` 475 483 */ 476 - export interface EncodingObject { 484 + export interface EncodingObject extends SpecificationExtensions { 477 485 /** 478 486 * 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. 479 487 */ ··· 569 577 * $ref: '#/components/examples/confirmation-success' 570 578 * ``` 571 579 */ 572 - export interface ExampleObject { 580 + export interface ExampleObject extends SpecificationExtensions { 573 581 /** 574 582 * Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 575 583 */ ··· 599 607 * url: https://example.com 600 608 * ``` 601 609 */ 602 - export interface ExternalDocumentationObject { 610 + export interface ExternalDocumentationObject extends SpecificationExtensions { 603 611 /** 604 612 * A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 605 613 */ ··· 647 655 * version: 1.0.1 648 656 * ``` 649 657 */ 650 - export interface InfoObject { 658 + export interface InfoObject extends SpecificationExtensions { 651 659 /** 652 660 * The contact information for the exposed API. 653 661 */ ··· 689 697 * identifier: Apache-2.0 690 698 * ``` 691 699 */ 692 - export interface LicenseObject { 700 + export interface LicenseObject extends SpecificationExtensions { 693 701 /** 694 702 * An {@link https://spdx.org/licenses/ SPDX} license expression for the API. The `identifier` field is mutually exclusive of the `url` field. 695 703 */ ··· 851 859 * 852 860 * Runtime expressions preserve the type of the referenced value. Expressions can be embedded into string values by surrounding the expression with `{}` curly braces. 853 861 */ 854 - export interface LinkObject { 862 + export interface LinkObject extends SpecificationExtensions { 855 863 /** 856 864 * A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 857 865 */ ··· 911 919 * $ref: "#/components/examples/frog-example" 912 920 * ``` 913 921 */ 914 - export interface MediaTypeObject { 922 + export interface MediaTypeObject extends SpecificationExtensions { 915 923 /** 916 924 * 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`. 917 925 */ ··· 953 961 * read:pets: read your pets 954 962 * ``` 955 963 */ 956 - export interface OAuthFlowObject { 964 + export interface OAuthFlowObject extends SpecificationExtensions { 957 965 /** 958 966 * **REQUIRED (`"implicit"`, `"authorizationCode"`)**. 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. 959 967 */ ··· 977 985 * 978 986 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}. 979 987 */ 980 - export interface OAuthFlowsObject { 988 + export interface OAuthFlowsObject extends SpecificationExtensions { 981 989 /** 982 990 * Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0. 983 991 */ ··· 1045 1053 * - read:pets 1046 1054 * ``` 1047 1055 */ 1048 - export interface OperationObject { 1049 - [extension: `x-${string}`]: unknown; 1056 + export interface OperationObject extends SpecificationExtensions { 1050 1057 /** 1051 1058 * 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. 1052 1059 */ ··· 1194 1201 * type: number 1195 1202 * ``` 1196 1203 */ 1197 - export interface ParameterObject { 1198 - [extension: `x-${string}`]: unknown; 1204 + export interface ParameterObject extends SpecificationExtensions { 1199 1205 /** 1200 1206 * 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. 1201 1207 */ ··· 1298 1304 * style: simple 1299 1305 * ``` 1300 1306 */ 1301 - export interface PathItemObject { 1307 + export interface PathItemObject extends SpecificationExtensions { 1302 1308 /** 1303 1309 * 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}. 1304 1310 */ ··· 1398 1404 * $ref: '#/components/schemas/pet' 1399 1405 * ``` 1400 1406 */ 1401 - export interface PathsObject { 1407 + export interface PathsObject extends SpecificationExtensions { 1402 1408 /** 1403 1409 * 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. 1404 1410 */ ··· 1503 1509 * type: string 1504 1510 * ``` 1505 1511 */ 1506 - export interface RequestBodyObject { 1512 + export interface RequestBodyObject extends SpecificationExtensions { 1507 1513 /** 1508 1514 * **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/* 1509 1515 */ ··· 1579 1585 * description: object created 1580 1586 * ``` 1581 1587 */ 1582 - export interface ResponseObject { 1588 + export interface ResponseObject extends SpecificationExtensions { 1583 1589 /** 1584 1590 * 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/* 1585 1591 */ ··· 1627 1633 * $ref: '#/components/schemas/ErrorModel' 1628 1634 * ``` 1629 1635 */ 1630 - export interface ResponsesObject { 1636 + export interface ResponsesObject extends SpecificationExtensions { 1631 1637 /** 1632 1638 * 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. 1633 1639 */ ··· 1749 1755 * read:pets: read your pets 1750 1756 * ``` 1751 1757 */ 1752 - export type SecuritySchemeObject = { 1758 + export type SecuritySchemeObject = SpecificationExtensions & { 1753 1759 /** 1754 1760 * A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 1755 1761 */ 1756 1762 description?: string; 1757 1763 } & ( 1758 - | { 1759 - /** 1760 - * **REQUIRED**. The location of the API key. Valid values are "query", "header" or "cookie". 1761 - */ 1762 - in: 'cookie' | 'header' | 'query'; 1763 - /** 1764 - * **REQUIRED**. The name of the header, query or cookie parameter to be used. 1765 - */ 1766 - name: string; 1767 - /** 1768 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1769 - */ 1770 - type: 'apiKey'; 1771 - } 1772 - | { 1773 - /** 1774 - * 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. 1775 - */ 1776 - bearerFormat?: string; 1777 - /** 1778 - * **REQUIRED**. The name of the HTTP Authorization 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}. 1779 - */ 1780 - scheme: string; 1781 - /** 1782 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1783 - */ 1784 - type: 'http'; 1785 - } 1786 - | { 1787 - /** 1788 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1789 - */ 1790 - type: 'mutualTLS'; 1791 - } 1792 - | { 1793 - /** 1794 - * **REQUIRED**. An object containing configuration information for the flow types supported. 1795 - */ 1796 - flows: OAuthFlowsObject; 1797 - /** 1798 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1799 - */ 1800 - type: 'oauth2'; 1801 - } 1802 - | { 1803 - /** 1804 - * **REQUIRED**. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL. The OpenID Connect standard requires the use of TLS. 1805 - */ 1806 - openIdConnectUrl: string; 1807 - /** 1808 - * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1809 - */ 1810 - type: 'openIdConnect'; 1811 - } 1812 - ); 1764 + | { 1765 + /** 1766 + * **REQUIRED**. The location of the API key. Valid values are "query", "header" or "cookie". 1767 + */ 1768 + in: 'cookie' | 'header' | 'query'; 1769 + /** 1770 + * **REQUIRED**. The name of the header, query or cookie parameter to be used. 1771 + */ 1772 + name: string; 1773 + /** 1774 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1775 + */ 1776 + type: 'apiKey'; 1777 + } 1778 + | { 1779 + /** 1780 + * 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. 1781 + */ 1782 + bearerFormat?: string; 1783 + /** 1784 + * **REQUIRED**. The name of the HTTP Authorization 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}. 1785 + */ 1786 + scheme: string; 1787 + /** 1788 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1789 + */ 1790 + type: 'http'; 1791 + } 1792 + | { 1793 + /** 1794 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1795 + */ 1796 + type: 'mutualTLS'; 1797 + } 1798 + | { 1799 + /** 1800 + * **REQUIRED**. An object containing configuration information for the flow types supported. 1801 + */ 1802 + flows: OAuthFlowsObject; 1803 + /** 1804 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1805 + */ 1806 + type: 'oauth2'; 1807 + } 1808 + | { 1809 + /** 1810 + * **REQUIRED**. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL. The OpenID Connect standard requires the use of TLS. 1811 + */ 1812 + openIdConnectUrl: string; 1813 + /** 1814 + * **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`. 1815 + */ 1816 + type: 'openIdConnect'; 1817 + } 1818 + ); 1813 1819 1814 1820 /** 1815 1821 * An object representing a Server. ··· 1822 1828 * description: Development server 1823 1829 * ``` 1824 1830 */ 1825 - export interface ServerObject { 1831 + export interface ServerObject extends SpecificationExtensions { 1826 1832 /** 1827 1833 * An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 1828 1834 */ ··· 1842 1848 * 1843 1849 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}. 1844 1850 */ 1845 - export interface ServerVariableObject { 1851 + export interface ServerVariableObject extends SpecificationExtensions { 1846 1852 /** 1847 1853 * **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. 1848 1854 */ ··· 1868 1874 * description: Pets operations 1869 1875 * ``` 1870 1876 */ 1871 - export interface TagObject { 1877 + export interface TagObject extends SpecificationExtensions { 1872 1878 /** 1873 1879 * A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation. 1874 1880 */ ··· 2075 2081 * </aliens> 2076 2082 * ``` 2077 2083 */ 2078 - export interface XMLObject { 2084 + export interface XMLObject extends SpecificationExtensions { 2079 2085 /** 2080 2086 * Declares whether the property definition translates to an attribute instead of an element. Default value is `false`. 2081 2087 */