···11+---
22+"@hey-api/spec-types": patch
33+---
44+55+**types**: fix: use mutable arrays
+5
.changeset/deep-paws-call.md
···11+---
22+"@hey-api/spec-types": minor
33+---
44+55+**BREAKING**: rename `OpenAPIExtensions` to `SpecExtensions`
+5
.changeset/olive-sides-mate.md
···11+---
22+"@hey-api/spec-types": minor
33+---
44+55+**BREAKING**: remove OpenAPI types from JSON Schema documents
+5
.changeset/short-walls-battle.md
···11+---
22+"@hey-api/spec-types": patch
33+---
44+55+**openapi**: fix: stricter 2.0 version type
+5-5
packages/shared/src/ir/types.ts
···11/* eslint-disable @typescript-eslint/no-namespace */
22import type { Symbol } from '@hey-api/codegen-core';
33-import type { JSONSchemaDraft2020_12, OpenAPIExtensions, OpenAPIV3_1 } from '@hey-api/spec-types';
33+import type { JSONSchemaDraft2020_12, OpenAPIV3_1, SpecExtensions } from '@hey-api/spec-types';
4455import type { IRMediaType } from './mediaType';
66···2222 schemas?: Record<string, IRSchemaObject>;
2323}
24242525-export interface IROperationObject extends OpenAPIExtensions {
2525+export interface IROperationObject extends SpecExtensions {
2626 body?: IRBodyObject;
2727 deprecated?: boolean;
2828 description?: string;
···4646}
47474848export interface IRParameterObject
4949- extends Pick<JSONSchemaDraft2020_12.Document, 'deprecated' | 'description'>, OpenAPIExtensions {
4949+ extends Pick<JSONSchemaDraft2020_12.Document, 'deprecated' | 'description'>, SpecExtensions {
5050 /**
5151 * Determines whether the parameter value SHOULD allow reserved characters, as defined by 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 `contentType` (implicit or explicit) SHALL be ignored.
5252 */
···130130 | 'pattern'
131131 | 'required'
132132 | 'title'
133133- | 'example'
134133 >,
135135- OpenAPIExtensions {
134134+ Pick<OpenAPIV3_1.SchemaObject, 'example'>,
135135+ SpecExtensions {
136136 /**
137137 * If the schema is intended to be used as an object property, it can be
138138 * marked as read-only or write-only. This value controls whether the schema
···11-export type {
22- CodeSampleObject,
33- EnumExtensions,
44- LinguistLanguages,
55- OpenAPIExtensions,
66-} from './extensions/openapi';
11+export type { CodeSampleObject, LinguistLanguages } from './extensions/code-samples';
22+export type { EnumExtensions } from './extensions/enum';
33+export type { SpecExtensions } from './extensions/spec';
74export type * as JSONSchemaDraft4 from './json-schema/draft-4';
85export type * as JSONSchemaDraft2020_12 from './json-schema/draft-2020-12';
96export * as JSONSchema from './json-schema/union';
···11import type { AnyString, MaybeArray } from '@hey-api/types';
2233-import type { EnumExtensions, OpenAPIExtensions } from '../../extensions/openapi';
44-import type { OpenAPIV3_1SchemaExtensions } from '../../openapi/v3-1/extensions';
55-63// TODO: left out some keywords related to structuring a complex schema and declaring a dialect
77-export interface Document
88- extends
99- ArrayKeywords,
1010- NumberKeywords,
1111- ObjectKeywords,
1212- StringKeywords,
1313- EnumExtensions,
1414- OpenAPIV3_1SchemaExtensions,
1515- OpenAPIExtensions {
44+export interface BaseDocument<TDocument = unknown>
55+ extends ArrayKeywords<TDocument>, NumberKeywords, ObjectKeywords<TDocument>, StringKeywords {
166 /**
177 * 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.
188 */
···3020 *
3121 * {@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.
3222 */
3333- allOf?: ReadonlyArray<Document>;
2323+ allOf?: Array<TDocument>;
3424 /**
3525 * `anyOf`: (OR) Must be valid against _any_ of the subschemas
3626 *
3727 * To validate against `anyOf`, the given data must be valid against any (one or more) of the given subschemas.
3828 */
3939- anyOf?: ReadonlyArray<Document>;
2929+ anyOf?: Array<TDocument>;
4030 /**
4131 * The `const` keyword is used to restrict a value to a single value.
4232 */
···6252 /**
6353 * 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.
6454 */
6565- dependentRequired?: Record<string, ReadonlyArray<string>>;
5555+ dependentRequired?: Record<string, Array<string>>;
6656 /**
6757 * 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.
6858 */
6969- dependentSchemas?: Record<string, Document>;
5959+ dependentSchemas?: Record<string, TDocument>;
7060 /**
7161 * The `deprecated` keyword is a boolean that indicates that the {@link https://json-schema.org/learn/glossary#instance instance} value the keyword applies to should not be used and may be removed in the future.
7262 */
···8474 *
8575 * If `then` and/or `else` appear in a schema without `if`, `then` and `else` are ignored.
8676 */
8787- else?: Document;
7777+ else?: TDocument;
8878 /**
8979 * The `enum` {@link https://json-schema.org/learn/glossary#keyword keyword} is used to restrict a value to a fixed set of values. It must be an array with at least one element, where each element is unique.
9080 *
9181 * You can use `enum` even without a type, to accept values of different types.
9282 */
9393- enum?: ReadonlyArray<unknown>;
8383+ enum?: Array<unknown>;
9484 /**
9585 * 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.
9686 */
9797- examples?: ReadonlyArray<unknown>;
8787+ examples?: Array<unknown>;
9888 /**
9989 * 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.
10090 *
···112102 *
113103 * If `then` and/or `else` appear in a schema without `if`, `then` and `else` are ignored.
114104 */
115115- if?: Document;
105105+ if?: TDocument;
116106 /**
117107 * `not`: (NOT) Must _not_ be valid against the given schema
118108 *
119109 * The `not` keyword declares that an instance validates if it doesn't validate against the given subschema.
120110 */
121121- not?: Document;
111111+ not?: TDocument;
122112 /**
123113 * `oneOf`: (XOR) Must be valid against _exactly one_ of the subschemas
124114 *
···126116 *
127117 * 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.
128118 */
129129- oneOf?: ReadonlyArray<Document>;
119119+ oneOf?: Array<TDocument>;
130120 /**
131121 * 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.
132122 */
···140130 *
141131 * If `then` and/or `else` appear in a schema without `if`, `then` and `else` are ignored.
142132 */
143143- then?: Document;
133133+ then?: TDocument;
144134 /**
145135 * 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.
146136 */
···155145 writeOnly?: boolean;
156146}
157147158158-export interface ArrayKeywords {
148148+export type Document = BaseDocument<Document>;
149149+150150+export interface ArrayKeywords<TDocument = unknown> {
159151 /**
160152 * While the `items` schema must be valid for every item in the array, the `contains` schema only needs to validate against one or more items in the array.
161153 */
162162- contains?: Document;
154154+ contains?: TDocument;
163155 /**
164156 * List validation is useful for arrays of arbitrary length where each item matches the same schema. For this kind of array, set the `items` {@link https://json-schema.org/learn/glossary#keyword keyword} to a single schema that will be used to validate all of the items in the array.
165157 *
···167159 *
168160 * Note that `items` doesn't "see inside" any {@link https://json-schema.org/learn/glossary#instance instances} of `allOf`, `anyOf`, or `oneOf` in the same {@link https://json-schema.org/learn/glossary#subschema subschema}.
169161 */
170170- items?: Document | false;
162162+ items?: TDocument | false;
171163 /**
172164 * `minContains` and `maxContains` can be used with `contains` to further specify how many times a schema matches a `contains` constraint. These keywords can be any non-negative number including zero.
173165 */
···187179 /**
188180 * `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.
189181 */
190190- prefixItems?: ReadonlyArray<Document>;
182182+ prefixItems?: Array<TDocument>;
191183 /**
192184 * The `unevaluatedItems` keyword is useful mainly when you want to add or disallow extra items to an array.
193185 *
···197189 *
198190 * Like with `items`, if you set `unevaluatedItems` to false, you can disallow extra items in the array.
199191 */
200200- unevaluatedItems?: Document | false;
192192+ unevaluatedItems?: TDocument | false;
201193 /**
202194 * A schema can ensure that each of the items in an array is unique. Simply set the `uniqueItems` keyword to `true`.
203195 */
···271263 multipleOf?: number;
272264}
273265274274-export interface ObjectKeywords {
266266+export interface ObjectKeywords<TDocument = unknown> {
275267 /**
276268 * The `additionalProperties` keyword is used to control the handling of extra stuff, that is, properties whose names are not listed in the `properties` keyword or match any of the regular expressions in the `patternProperties` keyword. By default any additional properties are allowed.
277269 *
···279271 *
280272 * It's important to note that `additionalProperties` only recognizes properties declared in the same {@link https://json-schema.org/learn/glossary#subschema subschema} as itself. So, `additionalProperties` can restrict you from "extending" a schema using {@link https://json-schema.org/understanding-json-schema/reference/combining combining} keywords such as {@link https://json-schema.org/understanding-json-schema/reference/combining#allof allOf}.
281273 */
282282- additionalProperties?: Document | false;
274274+ additionalProperties?: TDocument | false;
283275 /**
284276 * The number of properties on an object can be restricted using the `minProperties` and `maxProperties` keywords. Each of these must be a non-negative integer.
285277 */
···291283 /**
292284 * Sometimes you want to say that, given a particular kind of property name, the value should match a particular schema. That's where `patternProperties` comes in: it maps regular expressions to schemas. If a property name matches the given regular expression, the property value must validate against the corresponding schema.
293285 */
294294- patternProperties?: Record<string, Document>;
286286+ patternProperties?: Record<string, TDocument>;
295287 /**
296288 * The properties (key-value pairs) on an object are defined using the `properties` {@link https://json-schema.org/learn/glossary#keyword keyword}. The value of `properties` is an object, where each key is the name of a property and each value is a {@link https://json-schema.org/learn/glossary#schema schema} used to validate that property. Any property that doesn't match any of the property names in the `properties` keyword is ignored by this keyword.
297289 */
298298- properties?: Record<string, Document | true>;
290290+ properties?: Record<string, TDocument | true>;
299291 /**
300292 * The names of properties can be validated against a schema, irrespective of their values. This can be useful if you don't want to enforce specific properties, but you want to make sure that the names of those properties follow a specific convention. You might, for example, want to enforce that all names are valid ASCII tokens so they can be used as attributes in a particular programming language.
301293 *
···305297 * { "type": "string" }
306298 * ```
307299 */
308308- propertyNames?: Document;
300300+ propertyNames?: TDocument;
309301 /**
310302 * By default, the properties defined by the `properties` keyword are not required. However, one can provide a list of required properties using the `required` keyword.
311303 *
312304 * The `required` keyword takes an array of zero or more strings. Each of these strings must be unique.
313305 */
314314- required?: ReadonlyArray<string>;
306306+ required?: Array<string>;
315307 /**
316308 * 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.
317309 *
318310 * `unevaluatedProperties` works by collecting any properties that are successfully validated when processing the schemas and using those as the allowed list of properties. This allows you to do more complex things like conditionally adding properties.
319311 */
320320- unevaluatedProperties?: Document | false;
312312+ unevaluatedProperties?: TDocument | false;
321313}
322314323315export interface StringKeywords {
···11import type { AnyString } from '@hey-api/types';
2233-import type { EnumExtensions } from '../../extensions/openapi';
44-55-export interface Document extends EnumExtensions {
33+export interface Document {
64 /**
75 * A schema can reference another schema using the `$ref` keyword. The value of `$ref` is a URI-reference that is resolved against the schema's {@link https://json-schema.org/understanding-json-schema/structuring#base-uri Base URI}. When evaluating a `$ref`, an implementation uses the resolved identifier to retrieve the referenced schema and applies that schema to the {@link https://json-schema.org/learn/glossary#instance instance}.
86 *
···2220 *
2321 * You can use `enum` even without a type, to accept values of different types.
2422 */
2525- enum?: ReadonlyArray<unknown>;
2323+ enum?: Array<unknown>;
2624 /**
2725 * Ranges of numbers are specified using a combination of the `minimum` and `maximum` keywords, (or `exclusiveMinimum` and `exclusiveMaximum` for expressing exclusive range).
2826 *
···128126 *
129127 * The `required` keyword takes an array of zero or more strings. Each of these strings must be unique.
130128 */
131131- required?: ReadonlyArray<string>;
129129+ required?: Array<string>;
132130 /**
133131 * 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.
134132 */
+24-22
packages/spec-types/src/openapi/v2/spec.ts
···11-import type { CodeSampleObject, EnumExtensions } from '../../extensions/openapi';
22-import type { Document as JSONSchemaDraft4 } from '../../json-schema/draft-4/spec';
11+import type { CodeSampleObject } from '../../extensions/code-samples';
22+import type { EnumExtensions } from '../../extensions/enum';
33+import type { Document as JSONSchemaDraft4 } from '../../json-schema/draft-4';
34import type { OpenAPIV2NullableExtensions } from './extensions';
4556/**
···1718 /**
1819 * 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}.
1920 */
2020- consumes?: ReadonlyArray<string>;
2121+ consumes?: Array<string>;
2122 /**
2223 * An object to hold data types produced and consumed by operations.
2324 */
···4546 /**
4647 * 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}.
4748 */
4848- produces?: ReadonlyArray<string>;
4949+ produces?: Array<string>;
4950 /**
5051 * An object to hold responses that can be used across operations. This property _does not_ define global responses for all operations.
5152 */
···5354 /**
5455 * 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.
5556 */
5656- schemes?: ReadonlyArray<'http' | 'https' | 'ws' | 'wss'>;
5757+ schemes?: Array<'http' | 'https' | 'ws' | 'wss'>;
5758 /**
5859 * 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.
5960 */
6060- security?: ReadonlyArray<SecurityRequirementObject>;
6161+ security?: Array<SecurityRequirementObject>;
6162 /**
6263 * Security scheme definitions that can be used across the specification.
6364 */
···6566 /**
6667 * **Required**. Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value MUST be `"2.0"`.
6768 */
6868- swagger: string;
6969+ swagger: '2.0';
6970 /**
7071 * 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.
7172 */
7272- tags?: ReadonlyArray<TagObject>;
7373+ tags?: Array<TagObject>;
7374}
74757576/**
···219220 /**
220221 * 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}.
221222 */
222222- enum?: ReadonlyArray<unknown>;
223223+ enum?: Array<unknown>;
223224 /**
224225 * 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}.
225226 */
···401402 /**
402403 * 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}.
403404 */
404404- enum?: ReadonlyArray<unknown>;
405405+ enum?: Array<unknown>;
405406 /**
406407 * 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}.
407408 */
···534535 /**
535536 * 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}.
536537 */
537537- consumes?: ReadonlyArray<string>;
538538+ consumes?: Array<string>;
538539 /**
539540 * Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is `false`.
540541 */
···554555 /**
555556 * 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.
556557 */
557557- parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
558558+ parameters?: Array<ParameterObject | ReferenceObject>;
558559 /**
559560 * 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}.
560561 */
561561- produces?: ReadonlyArray<string>;
562562+ produces?: Array<string>;
562563 /**
563564 * **Required**. The list of possible responses as they are returned from executing this operation.
564565 */
···566567 /**
567568 * 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.
568569 */
569569- schemes?: ReadonlyArray<'http' | 'https' | 'ws' | 'wss'>;
570570+ schemes?: Array<'http' | 'https' | 'ws' | 'wss'>;
570571 /**
571572 * 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.
572573 */
573573- security?: ReadonlyArray<SecurityRequirementObject>;
574574+ security?: Array<SecurityRequirementObject>;
574575 /**
575576 * A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
576577 */
···578579 /**
579580 * A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
580581 */
581581- tags?: ReadonlyArray<string>;
582582+ tags?: Array<string>;
582583 /**
583584 * A list of code samples associated with an operation.
584585 */
585585- 'x-codeSamples'?: ReadonlyArray<CodeSampleObject>;
586586+ 'x-codeSamples'?: Array<CodeSampleObject>;
586587}
587588588589/**
···739740 /**
740741 * 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}.
741742 */
742742- enum?: ReadonlyArray<unknown>;
743743+ enum?: Array<unknown>;
743744 /**
744745 * 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}.
745746 */
···897898 /**
898899 * 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.
899900 */
900900- parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
901901+ parameters?: Array<ParameterObject | ReferenceObject>;
901902 /**
902903 * A definition of a PATCH operation on this path.
903904 */
···13061307 * - packSize
13071308 * ```
13081309 */
13091309-export interface SchemaObject extends JSONSchemaDraft4, OpenAPIV2NullableExtensions {
13101310+export interface SchemaObject
13111311+ extends JSONSchemaDraft4, EnumExtensions, OpenAPIV2NullableExtensions {
13101312 /**
13111313 * Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#specification-extensions Vendor Extensions} for further details.
13121314 */
···13261328 *
13271329 * {@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.
13281330 */
13291329- allOf?: ReadonlyArray<SchemaObject>;
13311331+ allOf?: Array<SchemaObject>;
13301332 /**
13311333 * 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.
13321334 */
···14411443 /**
14421444 * 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.
14431445 */
14441444- [name: string]: ReadonlyArray<string>;
14461446+ [name: string]: Array<string>;
14451447}
1446144814471449/**
+49-41
packages/spec-types/src/openapi/v3-1/spec.ts
···11-import type { CodeSampleObject, OpenAPIExtensions } from '../../extensions/openapi';
22-import type { Document as JSONSchemaDraft2020_12 } from '../../json-schema/draft-2020-12';
11+import type { CodeSampleObject } from '../../extensions/code-samples';
22+import type { EnumExtensions } from '../../extensions/enum';
33+import type { SpecExtensions } from '../../extensions/spec';
44+import type { BaseDocument as JSONSchemaDraft2020_12 } from '../../json-schema/draft-2020-12';
55+import type { OpenAPIV3_1SchemaExtensions } from './extensions';
3647/**
58 * 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}.
69 *
710 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
811 */
99-export interface Document extends OpenAPIExtensions {
1212+export interface Document extends SpecExtensions {
1013 /**
1114 * An element to hold various schemas for the document.
1215 */
···3437 /**
3538 * 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.
3639 */
3737- security?: ReadonlyArray<SecurityRequirementObject>;
4040+ security?: Array<SecurityRequirementObject>;
3841 /**
3942 * 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 `/`.
4043 */
4141- servers?: ReadonlyArray<ServerObject>;
4444+ servers?: Array<ServerObject>;
4245 /**
4346 * 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.
4447 */
4545- tags?: ReadonlyArray<TagObject>;
4848+ tags?: Array<TagObject>;
4649 /**
4750 * 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.
4851 */
···130133 * description: callback successfully processed
131134 * ```
132135 */
133133-export interface CallbackObject extends OpenAPIExtensions {
136136+export interface CallbackObject extends SpecExtensions {
134137 /**
135138 * 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.
136139 */
···226229 * read:pets: read your pets
227230 * ```
228231 */
229229-export interface ComponentsObject extends OpenAPIExtensions {
232232+export interface ComponentsObject extends SpecExtensions {
230233 /**
231234 * An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object Callback Objects}.
232235 */
···281284 * email: support@example.com
282285 * ```
283286 */
284284-export interface ContactObject extends OpenAPIExtensions {
287287+export interface ContactObject extends SpecExtensions {
285288 /**
286289 * The email address of the contact person/organization. This MUST be in the form of an email address.
287290 */
···422425 *
423426 * will map to `Dog` because of the definition in the `mapping` element.
424427 */
425425-export interface DiscriminatorObject extends OpenAPIExtensions {
428428+export interface DiscriminatorObject extends SpecExtensions {
426429 /**
427430 * An object to hold mappings between payload values and schema names or references.
428431 */
···474477 * type: integer
475478 * ```
476479 */
477477-export interface EncodingObject extends OpenAPIExtensions {
480480+export interface EncodingObject extends SpecExtensions {
478481 /**
479482 * 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.
480483 */
···570573 * $ref: '#/components/examples/confirmation-success'
571574 * ```
572575 */
573573-export interface ExampleObject extends OpenAPIExtensions {
576576+export interface ExampleObject extends SpecExtensions {
574577 /**
575578 * Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
576579 */
···600603 * url: https://example.com
601604 * ```
602605 */
603603-export interface ExternalDocumentationObject extends OpenAPIExtensions {
606606+export interface ExternalDocumentationObject extends SpecExtensions {
604607 /**
605608 * A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
606609 */
···648651 * version: 1.0.1
649652 * ```
650653 */
651651-export interface InfoObject extends OpenAPIExtensions {
654654+export interface InfoObject extends SpecExtensions {
652655 /**
653656 * The contact information for the exposed API.
654657 */
···690693 * identifier: Apache-2.0
691694 * ```
692695 */
693693-export interface LicenseObject extends OpenAPIExtensions {
696696+export interface LicenseObject extends SpecExtensions {
694697 /**
695698 * An {@link https://spdx.org/licenses/ SPDX} license expression for the API. The `identifier` field is mutually exclusive of the `url` field.
696699 */
···852855 *
853856 * Runtime expressions preserve the type of the referenced value. Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
854857 */
855855-export interface LinkObject extends OpenAPIExtensions {
858858+export interface LinkObject extends SpecExtensions {
856859 /**
857860 * A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
858861 */
···912915 * $ref: "#/components/examples/frog-example"
913916 * ```
914917 */
915915-export interface MediaTypeObject extends OpenAPIExtensions {
918918+export interface MediaTypeObject extends SpecExtensions {
916919 /**
917920 * 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`.
918921 */
···954957 * read:pets: read your pets
955958 * ```
956959 */
957957-export interface OAuthFlowObject extends OpenAPIExtensions {
960960+export interface OAuthFlowObject extends SpecExtensions {
958961 /**
959962 * **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.
960963 */
···978981 *
979982 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
980983 */
981981-export interface OAuthFlowsObject extends OpenAPIExtensions {
984984+export interface OAuthFlowsObject extends SpecExtensions {
982985 /**
983986 * Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
984987 */
···10461049 * - read:pets
10471050 * ```
10481051 */
10491049-export interface OperationObject extends OpenAPIExtensions {
10521052+export interface OperationObject extends SpecExtensions {
10501053 /**
10511054 * 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.
10521055 */
···10701073 /**
10711074 * 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}.
10721075 */
10731073- parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
10761076+ parameters?: Array<ParameterObject | ReferenceObject>;
10741077 /**
10751078 * 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.
10761079 */
···10821085 /**
10831086 * 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.
10841087 */
10851085- security?: ReadonlyArray<SecurityRequirementObject>;
10881088+ security?: Array<SecurityRequirementObject>;
10861089 /**
10871090 * 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.
10881091 */
10891089- servers?: ReadonlyArray<ServerObject>;
10921092+ servers?: Array<ServerObject>;
10901093 /**
10911094 * A short summary of what the operation does.
10921095 */
···10941097 /**
10951098 * A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
10961099 */
10971097- tags?: ReadonlyArray<string>;
11001100+ tags?: Array<string>;
10981101 /**
10991102 * A list of code samples associated with an operation.
11001103 */
11011101- 'x-codeSamples'?: ReadonlyArray<CodeSampleObject>;
11041104+ 'x-codeSamples'?: Array<CodeSampleObject>;
11021105}
1103110611041107/**
···11981201 * type: number
11991202 * ```
12001203 */
12011201-export interface ParameterObject extends OpenAPIExtensions {
12041204+export interface ParameterObject extends SpecExtensions {
12021205 /**
12031206 * 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.
12041207 */
···13011304 * style: simple
13021305 * ```
13031306 */
13041304-export interface PathItemObject extends OpenAPIExtensions {
13071307+export interface PathItemObject extends SpecExtensions {
13051308 /**
13061309 * 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}.
13071310 */
···13291332 /**
13301333 * 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}.
13311334 */
13321332- parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
13351335+ parameters?: Array<ParameterObject | ReferenceObject>;
13331336 /**
13341337 * A definition of a PATCH operation on this path.
13351338 */
···13451348 /**
13461349 * An alternative `server` array to service all operations in this path.
13471350 */
13481348- servers?: ReadonlyArray<ServerObject>;
13511351+ servers?: Array<ServerObject>;
13491352 /**
13501353 * An optional, string summary, intended to apply to all operations in this path.
13511354 */
···14011404 * $ref: '#/components/schemas/pet'
14021405 * ```
14031406 */
14041404-export interface PathsObject extends OpenAPIExtensions {
14071407+export interface PathsObject extends SpecExtensions {
14051408 /**
14061409 * 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.
14071410 */
···15061509 * type: string
15071510 * ```
15081511 */
15091509-export interface RequestBodyObject extends OpenAPIExtensions {
15121512+export interface RequestBodyObject extends SpecExtensions {
15101513 /**
15111514 * **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/*
15121515 */
···15821585 * description: object created
15831586 * ```
15841587 */
15851585-export interface ResponseObject extends OpenAPIExtensions {
15881588+export interface ResponseObject extends SpecExtensions {
15861589 /**
15871590 * 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/*
15881591 */
···16301633 * $ref: '#/components/schemas/ErrorModel'
16311634 * ```
16321635 */
16331633-export interface ResponsesObject extends OpenAPIExtensions {
16361636+export interface ResponsesObject extends SpecExtensions {
16341637 /**
16351638 * 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.
16361639 */
···16651668 *
16661669 * 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.
16671670 */
16681668-export type SchemaObject = JSONSchemaDraft2020_12 & OpenAPIExtensions;
16711671+export interface SchemaObject
16721672+ extends
16731673+ JSONSchemaDraft2020_12<SchemaObject>,
16741674+ OpenAPIV3_1SchemaExtensions,
16751675+ SpecExtensions,
16761676+ EnumExtensions {}
1669167716701678/**
16711679 * 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}.
···17051713 /**
17061714 * 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.
17071715 */
17081708- [name: string]: ReadonlyArray<string>;
17161716+ [name: string]: Array<string>;
17091717}
1710171817111719/**
···17521760 * read:pets: read your pets
17531761 * ```
17541762 */
17551755-export type SecuritySchemeObject = OpenAPIExtensions & {
17631763+export type SecuritySchemeObject = SpecExtensions & {
17561764 /**
17571765 * A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
17581766 */
···18251833 * description: Development server
18261834 * ```
18271835 */
18281828-export interface ServerObject extends OpenAPIExtensions {
18361836+export interface ServerObject extends SpecExtensions {
18291837 /**
18301838 * An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
18311839 */
···18451853 *
18461854 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
18471855 */
18481848-export interface ServerVariableObject extends OpenAPIExtensions {
18561856+export interface ServerVariableObject extends SpecExtensions {
18491857 /**
18501858 * **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.
18511859 */
···18571865 /**
18581866 * An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty.
18591867 */
18601860- enum?: ReadonlyArray<string>;
18681868+ enum?: Array<string>;
18611869}
1862187018631871/**
···18711879 * description: Pets operations
18721880 * ```
18731881 */
18741874-export interface TagObject extends OpenAPIExtensions {
18821882+export interface TagObject extends SpecExtensions {
18751883 /**
18761884 * A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
18771885 */
···20782086 * </aliens>
20792087 * ```
20802088 */
20812081-export interface XMLObject extends OpenAPIExtensions {
20892089+export interface XMLObject extends SpecExtensions {
20822090 /**
20832091 * Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
20842092 */
+46-44
packages/spec-types/src/openapi/v3/spec.ts
···11-import type { CodeSampleObject, EnumExtensions, OpenAPIExtensions } from '../../extensions/openapi';
11+import type { CodeSampleObject } from '../../extensions/code-samples';
22+import type { EnumExtensions } from '../../extensions/enum';
33+import type { SpecExtensions } from '../../extensions/spec';
2435/**
46 * 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}.
57 *
68 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
79 */
88-export interface Document extends OpenAPIExtensions {
1010+export interface Document extends SpecExtensions {
911 /**
1012 * An element to hold various Objects for the OpenAPI Description.
1113 */
···2931 /**
3032 * 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.
3133 */
3232- security?: ReadonlyArray<SecurityRequirementObject>;
3434+ security?: Array<SecurityRequirementObject>;
3335 /**
3436 * 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 `/`.
3537 */
3636- servers?: ReadonlyArray<ServerObject>;
3838+ servers?: Array<ServerObject>;
3739 /**
3840 * 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.
3941 */
4040- tags?: ReadonlyArray<TagObject>;
4242+ tags?: Array<TagObject>;
4143}
42444345/**
···4749 *
4850 * TODO: examples
4951 */
5050-export interface CallbackObject extends OpenAPIExtensions {
5252+export interface CallbackObject extends SpecExtensions {
5153 /**
5254 * 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.
5355 */
···6365 *
6466 * TODO: examples
6567 */
6666-export interface ComponentsObject extends OpenAPIExtensions {
6868+export interface ComponentsObject extends SpecExtensions {
6769 /**
6870 * An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#callback-object Callback Objects}.
6971 */
···113115 * email: support@example.com
114116 * ```
115117 */
116116-export interface ContactObject extends OpenAPIExtensions {
118118+export interface ContactObject extends SpecExtensions {
117119 /**
118120 * The email address of the contact person/organization. This MUST be in the form of an email address.
119121 */
···160162 * TODO: default values examples
161163 * TODO: examples
162164 */
163163-export interface EncodingObject extends OpenAPIExtensions {
165165+export interface EncodingObject extends SpecExtensions {
164166 /**
165167 * 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`.
166168 */
···201203 *
202204 * TODO: examples
203205 */
204204-export interface ExampleObject extends OpenAPIExtensions {
206206+export interface ExampleObject extends SpecExtensions {
205207 /**
206208 * Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
207209 */
···232234 * url: https://example.com
233235 * ```
234236 */
235235-export interface ExternalDocumentationObject extends OpenAPIExtensions {
237237+export interface ExternalDocumentationObject extends SpecExtensions {
236238 /**
237239 * A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
238240 */
···276278 * version: 1.0.1
277279 * ```
278280 */
279279-export interface InfoObject extends OpenAPIExtensions {
281281+export interface InfoObject extends SpecExtensions {
280282 /**
281283 * The contact information for the exposed API.
282284 */
···313315 * url: https://www.apache.org/licenses/LICENSE-2.0.html
314316 * ```
315317 */
316316-export interface LicenseObject extends OpenAPIExtensions {
318318+export interface LicenseObject extends SpecExtensions {
317319 /**
318320 * **REQUIRED**. The license name used for the API.
319321 */
···339341 *
340342 * TODO: examples
341343 */
342342-export interface LinkObject extends OpenAPIExtensions {
344344+export interface LinkObject extends SpecExtensions {
343345 /**
344346 * A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
345347 */
···375377 *
376378 * TODO: examples
377379 */
378378-export interface MediaTypeObject extends OpenAPIExtensions {
380380+export interface MediaTypeObject extends SpecExtensions {
379381 /**
380382 * 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.
381383 */
···401403 *
402404 * TODO: examples
403405 */
404404-export interface OAuthFlowObject extends OpenAPIExtensions {
406406+export interface OAuthFlowObject extends SpecExtensions {
405407 /**
406408 * **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.
407409 */
···425427 *
426428 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
427429 */
428428-export interface OAuthFlowsObject extends OpenAPIExtensions {
430430+export interface OAuthFlowsObject extends SpecExtensions {
429431 /**
430432 * Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
431433 */
···451453 *
452454 * TODO: examples
453455 */
454454-export interface OperationObject extends OpenAPIExtensions {
456456+export interface OperationObject extends SpecExtensions {
455457 /**
456458 * 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.
457459 */
···475477 /**
476478 * 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`}.
477479 */
478478- parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
480480+ parameters?: Array<ParameterObject | ReferenceObject>;
479481 /**
480482 * 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.
481483 */
···487489 /**
488490 * 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.
489491 */
490490- security?: ReadonlyArray<SecurityRequirementObject>;
492492+ security?: Array<SecurityRequirementObject>;
491493 /**
492494 * 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.
493495 */
494494- servers?: ReadonlyArray<ServerObject>;
496496+ servers?: Array<ServerObject>;
495497 /**
496498 * A short summary of what the operation does.
497499 */
···499501 /**
500502 * A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
501503 */
502502- tags?: ReadonlyArray<string>;
504504+ tags?: Array<string>;
503505 /**
504506 * A list of code samples associated with an operation.
505507 */
506506- 'x-codeSamples'?: ReadonlyArray<CodeSampleObject>;
508508+ 'x-codeSamples'?: Array<CodeSampleObject>;
507509}
508510509511/**
···550552 *
551553 * TODO: examples
552554 */
553553-export interface ParameterObject extends OpenAPIExtensions {
555555+export interface ParameterObject extends SpecExtensions {
554556 /**
555557 * 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.
556558 */
···622624 *
623625 * TODO: examples
624626 */
625625-export interface PathItemObject extends OpenAPIExtensions {
627627+export interface PathItemObject extends SpecExtensions {
626628 /**
627629 * 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}.
628630 */
···650652 /**
651653 * 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`}.
652654 */
653653- parameters?: ReadonlyArray<ParameterObject | ReferenceObject>;
655655+ parameters?: Array<ParameterObject | ReferenceObject>;
654656 /**
655657 * A definition of a PATCH operation on this path.
656658 */
···666668 /**
667669 * 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.
668670 */
669669- servers?: ReadonlyArray<ServerObject>;
671671+ servers?: Array<ServerObject>;
670672 /**
671673 * An optional string summary, intended to apply to all operations in this path.
672674 */
···684686 *
685687 * TODO: examples
686688 */
687687-export interface PathsObject extends OpenAPIExtensions {
689689+export interface PathsObject extends SpecExtensions {
688690 /**
689691 * 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.
690692 */
···732734 *
733735 * TODO: examples
734736 */
735735-export interface RequestBodyObject extends OpenAPIExtensions {
737737+export interface RequestBodyObject extends SpecExtensions {
736738 /**
737739 * **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/*"`
738740 */
···754756 *
755757 * TODO: examples
756758 */
757757-export interface ResponseObject extends OpenAPIExtensions {
759759+export interface ResponseObject extends SpecExtensions {
758760 /**
759761 * 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/*"`
760762 */
···786788 *
787789 * TODO: examples
788790 */
789789-export interface ResponsesObject extends OpenAPIExtensions {
791791+export interface ResponsesObject extends SpecExtensions {
790792 /**
791793 * 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.
792794 */
···848850 *
849851 * TODO: content, examples
850852 */
851851-export interface SchemaObject extends EnumExtensions, OpenAPIExtensions {
853853+export interface SchemaObject extends EnumExtensions, SpecExtensions {
852854 /**
853855 * The value of "additionalProperties" MUST be a boolean or a schema.
854856 *
···870872 *
871873 * An instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword's value.
872874 */
873873- allOf?: ReadonlyArray<SchemaObject | ReferenceObject>;
875875+ allOf?: Array<SchemaObject | ReferenceObject>;
874876 /**
875877 * This keyword's value MUST be an array. This array MUST have at least one element.
876878 *
···879881 * An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this
880882 keyword's value.
881883 */
882882- anyOf?: ReadonlyArray<SchemaObject | ReferenceObject>;
884884+ anyOf?: Array<SchemaObject | ReferenceObject>;
883885 /**
884886 * 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`.
885887 */
···907909 *
908910 * An instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value.
909911 */
910910- enum?: ReadonlyArray<unknown>;
912912+ enum?: Array<unknown>;
911913 /**
912914 * 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.
913915 */
···10191021 *
10201022 * An instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword's value.
10211023 */
10221022- oneOf?: ReadonlyArray<SchemaObject | ReferenceObject>;
10241024+ oneOf?: Array<SchemaObject | ReferenceObject>;
10231025 /**
10241026 * 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.
10251027 *
···10411043 *
10421044 * An object instance is valid against this keyword if its property set contains all elements in this keyword's array value.
10431045 */
10441044- required?: ReadonlyArray<string>;
10461046+ required?: Array<string>;
10451047 /**
10461048 * The value of both of these keywords MUST be a string.
10471049 *
···10891091 /**
10901092 * 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.
10911093 */
10921092- [name: string]: ReadonlyArray<string>;
10941094+ [name: string]: Array<string>;
10931095}
1094109610951097/**
···11011103 *
11021104 * TODO: examples
11031105 */
11041104-export type SecuritySchemeObject = OpenAPIExtensions & {
11061106+export type SecuritySchemeObject = SpecExtensions & {
11051107 /**
11061108 * A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
11071109 */
···11641166 *
11651167 * TODO: examples
11661168 */
11671167-export interface ServerObject extends OpenAPIExtensions {
11691169+export interface ServerObject extends SpecExtensions {
11681170 /**
11691171 * An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
11701172 */
···11841186 *
11851187 * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
11861188 */
11871187-export interface ServerVariableObject extends OpenAPIExtensions {
11891189+export interface ServerVariableObject extends SpecExtensions {
11881190 /**
11891191 * **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.
11901192 */
···11961198 /**
11971199 * An enumeration of string values to be used if the substitution options are from a limited set. The array SHOULD NOT be empty.
11981200 */
11991199- enum?: ReadonlyArray<string>;
12011201+ enum?: Array<string>;
12001202}
1201120312021204/**
···12111213 * description: Pets operations
12121214 * ```
12131215 */
12141214-export interface TagObject extends OpenAPIExtensions {
12161216+export interface TagObject extends SpecExtensions {
12151217 /**
12161218 * A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
12171219 */
···12401242 *
12411243 * TODO: examples
12421244 */
12431243-export interface XMLObject extends OpenAPIExtensions {
12451245+export interface XMLObject extends SpecExtensions {
12441246 /**
12451247 * Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
12461248 */