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

Configure Feed

Select the types of activity you want to include in your feed.

fix: use mutable arrays

Lubos 2bc3eee5 05207e0e

+65 -60
+5
.changeset/clear-toes-enjoy.md
··· 1 + --- 2 + "@hey-api/spec-types": patch 3 + --- 4 + 5 + **types**: fix: use mutable arrays
+3 -3
packages/spec-types/src/extensions/openapi.ts
··· 46 46 /** 47 47 * `x-enum-descriptions` are {@link https://stackoverflow.com/a/66471626 supported} by OpenAPI Generator. 48 48 */ 49 - 'x-enum-descriptions'?: ReadonlyArray<string>; 49 + 'x-enum-descriptions'?: Array<string>; 50 50 /** 51 51 * `x-enum-varnames` are {@link https://stackoverflow.com/a/66471626 supported} by OpenAPI Generator. 52 52 */ 53 - 'x-enum-varnames'?: ReadonlyArray<string>; 53 + 'x-enum-varnames'?: Array<string>; 54 54 /** 55 55 * {@link https://github.com/RicoSuter/NSwag NSwag} generates `x-enumNames` field containing custom enum names. 56 56 */ 57 - 'x-enumNames'?: ReadonlyArray<string>; 57 + 'x-enumNames'?: Array<string>; 58 58 } 59 59 60 60 /**
+8 -8
packages/spec-types/src/json-schema/draft-2020-12/spec.ts
··· 30 30 * 31 31 * {@link https://json-schema.org/understanding-json-schema/reference/combining#allof allOf} can not be used to "extend" a schema to add more details to it in the sense of object-oriented inheritance. {@link https://json-schema.org/learn/glossary#instance Instances} must independently be valid against "all of" the schemas in the `allOf`. See the section on {@link https://json-schema.org/understanding-json-schema/reference/object#extending Extending Closed Schemas} for more information. 32 32 */ 33 - allOf?: ReadonlyArray<Document>; 33 + allOf?: Array<Document>; 34 34 /** 35 35 * `anyOf`: (OR) Must be valid against _any_ of the subschemas 36 36 * 37 37 * To validate against `anyOf`, the given data must be valid against any (one or more) of the given subschemas. 38 38 */ 39 - anyOf?: ReadonlyArray<Document>; 39 + anyOf?: Array<Document>; 40 40 /** 41 41 * The `const` keyword is used to restrict a value to a single value. 42 42 */ ··· 62 62 /** 63 63 * The `dependentRequired` {@link https://json-schema.org/learn/glossary#keyword keyword} conditionally requires that certain properties must be present if a given property is present in an object. For example, suppose we have a {@link https://json-schema.org/learn/glossary#schema schema} representing a customer. If you have their credit card number, you also want to ensure you have a billing address. If you don't have their credit card number, a billing address would not be required. We represent this dependency of one property on another using the `dependentRequired` keyword. The value of the `dependentRequired` keyword is an object. Each entry in the object maps from the name of a property, _p_, to an array of strings listing properties that are required if _p_ is present. 64 64 */ 65 - dependentRequired?: Record<string, ReadonlyArray<string>>; 65 + dependentRequired?: Record<string, Array<string>>; 66 66 /** 67 67 * The `dependentSchemas` keyword conditionally applies a {@link https://json-schema.org/learn/glossary#subschema subschema} when a given property is present. This schema is applied in the same way {@link https://json-schema.org/understanding-json-schema/reference/combining#allof allOf} applies schemas. Nothing is merged or extended. Both schemas apply independently. 68 68 */ ··· 90 90 * 91 91 * You can use `enum` even without a type, to accept values of different types. 92 92 */ 93 - enum?: ReadonlyArray<unknown>; 93 + enum?: Array<unknown>; 94 94 /** 95 95 * The `examples` keyword is a place to provide an array of examples that validate against the schema. This isn't used for validation, but may help with explaining the effect and purpose of the schema to a reader. Each entry should validate against the schema in which it resides, but that isn't strictly required. There is no need to duplicate the `default` value in the `examples` array, since `default` will be treated as another example. 96 96 */ 97 - examples?: ReadonlyArray<unknown>; 97 + examples?: Array<unknown>; 98 98 /** 99 99 * The `format` keyword allows for basic semantic identification of certain kinds of string values that are commonly used. For example, because JSON doesn't have a "DateTime" type, dates need to be encoded as strings. `format` allows the schema author to indicate that the string value should be interpreted as a date. By default, `format` is just an annotation and does not effect validation. 100 100 * ··· 126 126 * 127 127 * Careful consideration should be taken when using `oneOf` entries as the nature of it requires verification of _every_ sub-schema which can lead to increased processing times. Prefer `anyOf` where possible. 128 128 */ 129 - oneOf?: ReadonlyArray<Document>; 129 + oneOf?: Array<Document>; 130 130 /** 131 131 * The boolean keywords `readOnly` and `writeOnly` are typically used in an API context. `readOnly` indicates that a value should not be modified. It could be used to indicate that a `PUT` request that changes a value would result in a `400 Bad Request` response. `writeOnly` indicates that a value may be set, but will remain hidden. In could be used to indicate you can set a value with a `PUT` request, but it would not be included when retrieving that record with a `GET` request. 132 132 */ ··· 187 187 /** 188 188 * `prefixItems` is an array, where each item is a schema that corresponds to each index of the document's array. That is, an array where the first element validates the first element of the input array, the second element validates the second element of the input array, etc. 189 189 */ 190 - prefixItems?: ReadonlyArray<Document>; 190 + prefixItems?: Array<Document>; 191 191 /** 192 192 * The `unevaluatedItems` keyword is useful mainly when you want to add or disallow extra items to an array. 193 193 * ··· 311 311 * 312 312 * The `required` keyword takes an array of zero or more strings. Each of these strings must be unique. 313 313 */ 314 - required?: ReadonlyArray<string>; 314 + required?: Array<string>; 315 315 /** 316 316 * The `unevaluatedProperties` keyword is similar to `additionalProperties` except that it can recognize properties declared in subschemas. So, the example from the previous section can be rewritten without the need to redeclare properties. 317 317 *
+2 -2
packages/spec-types/src/json-schema/draft-4/spec.ts
··· 22 22 * 23 23 * You can use `enum` even without a type, to accept values of different types. 24 24 */ 25 - enum?: ReadonlyArray<unknown>; 25 + enum?: Array<unknown>; 26 26 /** 27 27 * Ranges of numbers are specified using a combination of the `minimum` and `maximum` keywords, (or `exclusiveMinimum` and `exclusiveMaximum` for expressing exclusive range). 28 28 * ··· 128 128 * 129 129 * The `required` keyword takes an array of zero or more strings. Each of these strings must be unique. 130 130 */ 131 - required?: ReadonlyArray<string>; 131 + required?: Array<string>; 132 132 /** 133 133 * The `title` and `description` keywords must be strings. A "title" will preferably be short, whereas a "description" will provide a more lengthy explanation about the purpose of the data described by the schema. 134 134 */
+18 -18
packages/spec-types/src/openapi/v2/spec.ts
··· 17 17 /** 18 18 * A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#mime-types Mime Types}. 19 19 */ 20 - consumes?: ReadonlyArray<string>; 20 + consumes?: Array<string>; 21 21 /** 22 22 * An object to hold data types produced and consumed by operations. 23 23 */ ··· 45 45 /** 46 46 * A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#mime-types Mime Types}. 47 47 */ 48 - produces?: ReadonlyArray<string>; 48 + produces?: Array<string>; 49 49 /** 50 50 * An object to hold responses that can be used across operations. This property _does not_ define global responses for all operations. 51 51 */ ··· 53 53 /** 54 54 * The transfer protocol of the API. Values MUST be from the list: `"http"`, `"https"`, `"ws"`, `"wss"`. If the `schemes` is not included, the default scheme to be used is the one used to access the Swagger definition itself. 55 55 */ 56 - schemes?: ReadonlyArray<'http' | 'https' | 'ws' | 'wss'>; 56 + schemes?: Array<'http' | 'https' | 'ws' | 'wss'>; 57 57 /** 58 58 * A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition. 59 59 */ 60 - security?: ReadonlyArray<SecurityRequirementObject>; 60 + security?: Array<SecurityRequirementObject>; 61 61 /** 62 62 * Security scheme definitions that can be used across the specification. 63 63 */ ··· 69 69 /** 70 70 * A list of tags used by the specification 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/2.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. 71 71 */ 72 - tags?: ReadonlyArray<TagObject>; 72 + tags?: Array<TagObject>; 73 73 } 74 74 75 75 /** ··· 219 219 /** 220 220 * See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1}. 221 221 */ 222 - enum?: ReadonlyArray<unknown>; 222 + enum?: Array<unknown>; 223 223 /** 224 224 * See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2}. 225 225 */ ··· 401 401 /** 402 402 * See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1}. 403 403 */ 404 - enum?: ReadonlyArray<unknown>; 404 + enum?: Array<unknown>; 405 405 /** 406 406 * See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2}. 407 407 */ ··· 534 534 /** 535 535 * A list of MIME types the operation can consume. This overrides the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerConsumes `consumes`} definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#mime-types Mime Types}. 536 536 */ 537 - consumes?: ReadonlyArray<string>; 537 + consumes?: Array<string>; 538 538 /** 539 539 * Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is `false`. 540 540 */ ··· 554 554 /** 555 555 * 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/2.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/2.0.md#parameterName name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#parameterIn location}. The list can use the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.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/2.0.md#swaggerParameters Swagger Object's parameters}. There can be one "body" parameter at most. 556 556 */ 557 - parameters?: ReadonlyArray<ParameterObject | ReferenceObject>; 557 + parameters?: Array<ParameterObject | ReferenceObject>; 558 558 /** 559 559 * A list of MIME types the operation can produce. This overrides the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerProduces `produces`} definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#mime-types Mime Types}. 560 560 */ 561 - produces?: ReadonlyArray<string>; 561 + produces?: Array<string>; 562 562 /** 563 563 * **Required**. The list of possible responses as they are returned from executing this operation. 564 564 */ ··· 566 566 /** 567 567 * The transfer protocol for the operation. Values MUST be from the list: `"http"`, `"https"`, `"ws"`, `"wss"`. The value overrides the Swagger Object {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerSchemes `schemes`} definition. 568 568 */ 569 - schemes?: ReadonlyArray<'http' | 'https' | 'ws' | 'wss'>; 569 + schemes?: Array<'http' | 'https' | 'ws' | 'wss'>; 570 570 /** 571 571 * A declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerSecurity `security`}. To remove a top-level security declaration, an empty array can be used. 572 572 */ 573 - security?: ReadonlyArray<SecurityRequirementObject>; 573 + security?: Array<SecurityRequirementObject>; 574 574 /** 575 575 * A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters. 576 576 */ ··· 578 578 /** 579 579 * A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier. 580 580 */ 581 - tags?: ReadonlyArray<string>; 581 + tags?: Array<string>; 582 582 /** 583 583 * A list of code samples associated with an operation. 584 584 */ 585 - 'x-codeSamples'?: ReadonlyArray<CodeSampleObject>; 585 + 'x-codeSamples'?: Array<CodeSampleObject>; 586 586 } 587 587 588 588 /** ··· 739 739 /** 740 740 * See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1}. 741 741 */ 742 - enum?: ReadonlyArray<unknown>; 742 + enum?: Array<unknown>; 743 743 /** 744 744 * See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2}. 745 745 */ ··· 897 897 /** 898 898 * 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/2.0.md#parameterName name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#parameterIn location}. The list can use the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.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/2.0.md#swaggerParameters Swagger Object's parameters}. There can be one "body" parameter at most. 899 899 */ 900 - parameters?: ReadonlyArray<ParameterObject | ReferenceObject>; 900 + parameters?: Array<ParameterObject | ReferenceObject>; 901 901 /** 902 902 * A definition of a PATCH operation on this path. 903 903 */ ··· 1326 1326 * 1327 1327 * {@link https://json-schema.org/understanding-json-schema/reference/combining#allof allOf} can not be used to "extend" a schema to add more details to it in the sense of object-oriented inheritance. {@link https://json-schema.org/learn/glossary#instance Instances} must independently be valid against "all of" the schemas in the `allOf`. See the section on {@link https://json-schema.org/understanding-json-schema/reference/object#extending Extending Closed Schemas} for more information. 1328 1328 */ 1329 - allOf?: ReadonlyArray<SchemaObject>; 1329 + allOf?: Array<SchemaObject>; 1330 1330 /** 1331 1331 * Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the `required` property list. When used, the value MUST be the name of this schema or any schema that inherits it. 1332 1332 */ ··· 1441 1441 /** 1442 1442 * Each name must correspond to a security scheme which is declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#securityDefinitions Security Definitions}. If the security scheme is of type `"oauth2"`, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty. 1443 1443 */ 1444 - [name: string]: ReadonlyArray<string>; 1444 + [name: string]: Array<string>; 1445 1445 } 1446 1446 1447 1447 /**
+12 -12
packages/spec-types/src/openapi/v3-1/spec.ts
··· 34 34 /** 35 35 * 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. 36 36 */ 37 - security?: ReadonlyArray<SecurityRequirementObject>; 37 + security?: Array<SecurityRequirementObject>; 38 38 /** 39 39 * 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 `/`. 40 40 */ 41 - servers?: ReadonlyArray<ServerObject>; 41 + servers?: Array<ServerObject>; 42 42 /** 43 43 * 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. 44 44 */ 45 - tags?: ReadonlyArray<TagObject>; 45 + tags?: Array<TagObject>; 46 46 /** 47 47 * 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. 48 48 */ ··· 1070 1070 /** 1071 1071 * 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}. 1072 1072 */ 1073 - parameters?: ReadonlyArray<ParameterObject | ReferenceObject>; 1073 + parameters?: Array<ParameterObject | ReferenceObject>; 1074 1074 /** 1075 1075 * 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. 1076 1076 */ ··· 1082 1082 /** 1083 1083 * 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. 1084 1084 */ 1085 - security?: ReadonlyArray<SecurityRequirementObject>; 1085 + security?: Array<SecurityRequirementObject>; 1086 1086 /** 1087 1087 * 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. 1088 1088 */ 1089 - servers?: ReadonlyArray<ServerObject>; 1089 + servers?: Array<ServerObject>; 1090 1090 /** 1091 1091 * A short summary of what the operation does. 1092 1092 */ ··· 1094 1094 /** 1095 1095 * A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier. 1096 1096 */ 1097 - tags?: ReadonlyArray<string>; 1097 + tags?: Array<string>; 1098 1098 /** 1099 1099 * A list of code samples associated with an operation. 1100 1100 */ 1101 - 'x-codeSamples'?: ReadonlyArray<CodeSampleObject>; 1101 + 'x-codeSamples'?: Array<CodeSampleObject>; 1102 1102 } 1103 1103 1104 1104 /** ··· 1329 1329 /** 1330 1330 * 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}. 1331 1331 */ 1332 - parameters?: ReadonlyArray<ParameterObject | ReferenceObject>; 1332 + parameters?: Array<ParameterObject | ReferenceObject>; 1333 1333 /** 1334 1334 * A definition of a PATCH operation on this path. 1335 1335 */ ··· 1345 1345 /** 1346 1346 * An alternative `server` array to service all operations in this path. 1347 1347 */ 1348 - servers?: ReadonlyArray<ServerObject>; 1348 + servers?: Array<ServerObject>; 1349 1349 /** 1350 1350 * An optional, string summary, intended to apply to all operations in this path. 1351 1351 */ ··· 1705 1705 /** 1706 1706 * 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. 1707 1707 */ 1708 - [name: string]: ReadonlyArray<string>; 1708 + [name: string]: Array<string>; 1709 1709 } 1710 1710 1711 1711 /** ··· 1857 1857 /** 1858 1858 * An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty. 1859 1859 */ 1860 - enum?: ReadonlyArray<string>; 1860 + enum?: Array<string>; 1861 1861 } 1862 1862 1863 1863 /**
+17 -17
packages/spec-types/src/openapi/v3/spec.ts
··· 29 29 /** 30 30 * 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. 31 31 */ 32 - security?: ReadonlyArray<SecurityRequirementObject>; 32 + security?: Array<SecurityRequirementObject>; 33 33 /** 34 34 * 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 `/`. 35 35 */ 36 - servers?: ReadonlyArray<ServerObject>; 36 + servers?: Array<ServerObject>; 37 37 /** 38 38 * 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. 39 39 */ 40 - tags?: ReadonlyArray<TagObject>; 40 + tags?: Array<TagObject>; 41 41 } 42 42 43 43 /** ··· 475 475 /** 476 476 * 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`}. 477 477 */ 478 - parameters?: ReadonlyArray<ParameterObject | ReferenceObject>; 478 + parameters?: Array<ParameterObject | ReferenceObject>; 479 479 /** 480 480 * 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. 481 481 */ ··· 487 487 /** 488 488 * 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. 489 489 */ 490 - security?: ReadonlyArray<SecurityRequirementObject>; 490 + security?: Array<SecurityRequirementObject>; 491 491 /** 492 492 * 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. 493 493 */ 494 - servers?: ReadonlyArray<ServerObject>; 494 + servers?: Array<ServerObject>; 495 495 /** 496 496 * A short summary of what the operation does. 497 497 */ ··· 499 499 /** 500 500 * A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier. 501 501 */ 502 - tags?: ReadonlyArray<string>; 502 + tags?: Array<string>; 503 503 /** 504 504 * A list of code samples associated with an operation. 505 505 */ 506 - 'x-codeSamples'?: ReadonlyArray<CodeSampleObject>; 506 + 'x-codeSamples'?: Array<CodeSampleObject>; 507 507 } 508 508 509 509 /** ··· 650 650 /** 651 651 * 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`}. 652 652 */ 653 - parameters?: ReadonlyArray<ParameterObject | ReferenceObject>; 653 + parameters?: Array<ParameterObject | ReferenceObject>; 654 654 /** 655 655 * A definition of a PATCH operation on this path. 656 656 */ ··· 666 666 /** 667 667 * 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. 668 668 */ 669 - servers?: ReadonlyArray<ServerObject>; 669 + servers?: Array<ServerObject>; 670 670 /** 671 671 * An optional string summary, intended to apply to all operations in this path. 672 672 */ ··· 870 870 * 871 871 * An instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword's value. 872 872 */ 873 - allOf?: ReadonlyArray<SchemaObject | ReferenceObject>; 873 + allOf?: Array<SchemaObject | ReferenceObject>; 874 874 /** 875 875 * This keyword's value MUST be an array. This array MUST have at least one element. 876 876 * ··· 879 879 * An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this 880 880 keyword's value. 881 881 */ 882 - anyOf?: ReadonlyArray<SchemaObject | ReferenceObject>; 882 + anyOf?: Array<SchemaObject | ReferenceObject>; 883 883 /** 884 884 * 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`. 885 885 */ ··· 907 907 * 908 908 * An instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value. 909 909 */ 910 - enum?: ReadonlyArray<unknown>; 910 + enum?: Array<unknown>; 911 911 /** 912 912 * 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. 913 913 */ ··· 1019 1019 * 1020 1020 * An instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword's value. 1021 1021 */ 1022 - oneOf?: ReadonlyArray<SchemaObject | ReferenceObject>; 1022 + oneOf?: Array<SchemaObject | ReferenceObject>; 1023 1023 /** 1024 1024 * 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. 1025 1025 * ··· 1041 1041 * 1042 1042 * An object instance is valid against this keyword if its property set contains all elements in this keyword's array value. 1043 1043 */ 1044 - required?: ReadonlyArray<string>; 1044 + required?: Array<string>; 1045 1045 /** 1046 1046 * The value of both of these keywords MUST be a string. 1047 1047 * ··· 1089 1089 /** 1090 1090 * 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. 1091 1091 */ 1092 - [name: string]: ReadonlyArray<string>; 1092 + [name: string]: Array<string>; 1093 1093 } 1094 1094 1095 1095 /** ··· 1196 1196 /** 1197 1197 * An enumeration of string values to be used if the substitution options are from a limited set. The array SHOULD NOT be empty. 1198 1198 */ 1199 - enum?: ReadonlyArray<string>; 1199 + enum?: Array<string>; 1200 1200 } 1201 1201 1202 1202 /**