@typespec/openapi3 1.18.0-dev.3 → 1.18.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cli/actions/convert/convert.d.ts +11 -1
- package/dist/src/cli/actions/convert/convert.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/convert.js +8 -0
- package/dist/src/cli/actions/convert/convert.js.map +1 -1
- package/dist/src/decorators.d.ts +4 -0
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.js +4 -0
- package/dist/src/decorators.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +10 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +1 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/openapi.d.ts +30 -3
- package/dist/src/openapi.d.ts.map +1 -1
- package/dist/src/openapi.js +16 -3
- package/dist/src/openapi.js.map +1 -1
- package/dist/src/schema-emitter.d.ts +1 -0
- package/dist/src/schema-emitter.d.ts.map +1 -1
- package/dist/src/schema-emitter.js +7 -4
- package/dist/src/schema-emitter.js.map +1 -1
- package/dist/src/types.d.ts +198 -19
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/src/types.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { Diagnostic, Service } from "@typespec/compiler";
|
|
2
2
|
import type { Contact, ExtensionKey, License } from "@typespec/openapi";
|
|
3
|
+
/**
|
|
4
|
+
* Intersection used by helpers that build schema keywords across supported versions.
|
|
5
|
+
* This is not a separate schema dialect: emitted keywords must still follow the selected OpenAPI version.
|
|
6
|
+
*/
|
|
3
7
|
export type CommonOpenAPI3Schema = OpenAPI3Schema & OpenAPISchema3_1 & OpenAPISchema3_2;
|
|
8
|
+
/** Schema shapes accepted across supported OpenAPI versions; interpret keywords using the enclosing document's version. */
|
|
4
9
|
export type SupportedOpenAPISchema = OpenAPI3Schema | OpenAPISchema3_1 | OpenAPISchema3_2;
|
|
10
|
+
/** Documents for the supported OpenAPI versions; narrow on `openapi` before using version-specific fields. */
|
|
5
11
|
export type SupportedOpenAPIDocuments = OpenAPI3Document | OpenAPIDocument3_1 | OpenAPIDocument3_2;
|
|
12
|
+
/** Vendor extension fields, whose names must begin with `x-`. */
|
|
6
13
|
export type Extensions = {
|
|
7
14
|
[key in ExtensionKey]?: any;
|
|
8
15
|
};
|
|
16
|
+
/** An OpenAPI 3.0 document, using the 3.0 schema vocabulary rather than JSON Schema 2020-12. */
|
|
9
17
|
export interface OpenAPI3Document extends Extensions {
|
|
18
|
+
/** OpenAPI specification version, independent of the API version in `info.version`. */
|
|
10
19
|
openapi: "3.0.0";
|
|
11
20
|
/**
|
|
12
21
|
* Provides metadata about the API. The metadata can be used by the clients if needed.
|
|
@@ -34,10 +43,11 @@ export interface OpenAPI3Document extends Extensions {
|
|
|
34
43
|
security?: Record<string, string[]>[];
|
|
35
44
|
}
|
|
36
45
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
46
|
+
* Documents and diagnostics for a TypeSpec service. Narrow on `versioned` to
|
|
47
|
+
* access either one document or the service's version snapshots.
|
|
39
48
|
*/
|
|
40
49
|
export type OpenAPI3ServiceRecord = OpenAPI3UnversionedServiceRecord | OpenAPI3VersionedServiceRecord;
|
|
50
|
+
/** A service emitted as one document, including services with only transient dependency versioning. */
|
|
41
51
|
export interface OpenAPI3UnversionedServiceRecord {
|
|
42
52
|
/** The service that generated this OpenAPI document */
|
|
43
53
|
readonly service: Service;
|
|
@@ -48,6 +58,7 @@ export interface OpenAPI3UnversionedServiceRecord {
|
|
|
48
58
|
/** The diagnostics created for this document */
|
|
49
59
|
readonly diagnostics: readonly Diagnostic[];
|
|
50
60
|
}
|
|
61
|
+
/** A versioned service whose documents are grouped by API version, not OpenAPI specification version. */
|
|
51
62
|
export interface OpenAPI3VersionedServiceRecord {
|
|
52
63
|
/** The service that generated this OpenAPI document */
|
|
53
64
|
readonly service: Service;
|
|
@@ -57,48 +68,74 @@ export interface OpenAPI3VersionedServiceRecord {
|
|
|
57
68
|
readonly versions: OpenAPI3VersionedDocumentRecord[];
|
|
58
69
|
}
|
|
59
70
|
/**
|
|
60
|
-
*
|
|
71
|
+
* One API-version snapshot of a versioned service, with its document-specific diagnostics.
|
|
61
72
|
*/
|
|
62
73
|
export interface OpenAPI3VersionedDocumentRecord {
|
|
63
74
|
/** The OpenAPI document*/
|
|
64
75
|
readonly document: SupportedOpenAPIDocuments;
|
|
65
76
|
/** The service that generated this OpenAPI document. */
|
|
66
77
|
readonly service: Service;
|
|
67
|
-
/** The version
|
|
78
|
+
/** The service's API version for this snapshot, not the OpenAPI specification version. */
|
|
68
79
|
readonly version: string;
|
|
69
80
|
/** The diagnostics created for this version. */
|
|
70
81
|
readonly diagnostics: readonly Diagnostic[];
|
|
71
82
|
}
|
|
83
|
+
/** API metadata shared by the document versions supported by this package. */
|
|
72
84
|
export interface OpenAPI3Info extends Extensions {
|
|
85
|
+
/** Human-readable API title, not an identifier for operations or schemas. */
|
|
73
86
|
title: string;
|
|
87
|
+
/** Longer API description; CommonMark may be used for rich text. */
|
|
74
88
|
description?: string;
|
|
89
|
+
/** URL of the API's terms of service. */
|
|
75
90
|
termsOfService?: string;
|
|
91
|
+
/** API or document version; does not select the OpenAPI specification version. */
|
|
76
92
|
version: string;
|
|
93
|
+
/** Contact details for questions about this API. */
|
|
77
94
|
contact?: Contact;
|
|
95
|
+
/** License governing use of the API. */
|
|
78
96
|
license?: License;
|
|
97
|
+
/** Short API summary, supported by OpenAPI 3.1 and later. */
|
|
79
98
|
summary?: string;
|
|
80
99
|
}
|
|
100
|
+
/** A target endpoint whose URL can contain named variable substitutions. */
|
|
81
101
|
export interface OpenAPI3Server {
|
|
102
|
+
/** Absolute or relative endpoint URL, with optional `{variable}` placeholders. */
|
|
82
103
|
url: string;
|
|
104
|
+
/** Human-readable explanation of when to use this endpoint. */
|
|
83
105
|
description?: string;
|
|
106
|
+
/** Substitutions keyed by the placeholder names used in `url`. */
|
|
84
107
|
variables?: Record<string, OpenAPI3ServerVariable>;
|
|
85
108
|
}
|
|
109
|
+
/** A string substitution for a server URL placeholder, with a required fallback value. */
|
|
86
110
|
export interface OpenAPI3ServerVariable {
|
|
111
|
+
/** Allowed substitutions; when supplied, must include `default`. */
|
|
87
112
|
enum?: string[];
|
|
113
|
+
/** Substitution used when the caller does not supply a value. */
|
|
88
114
|
default: string;
|
|
115
|
+
/** Explanation of the substitution, which may use CommonMark. */
|
|
89
116
|
description?: string;
|
|
90
117
|
}
|
|
118
|
+
/** A link to documentation outside the OpenAPI document. */
|
|
91
119
|
export interface OpenAPI3ExternalDocs {
|
|
120
|
+
/** URL at which the additional documentation can be found. */
|
|
92
121
|
url: string;
|
|
122
|
+
/** Explanation of the linked material, which may use CommonMark. */
|
|
93
123
|
description?: string;
|
|
94
124
|
}
|
|
125
|
+
/** Metadata for an operation tag; operations refer to it by `name`. */
|
|
95
126
|
export interface OpenAPI3Tag extends Extensions {
|
|
127
|
+
/** Tag identifier, unique within the document's tag list. */
|
|
96
128
|
name: string;
|
|
129
|
+
/** Explanation of the group of operations, which may use CommonMark. */
|
|
97
130
|
description?: string;
|
|
131
|
+
/** Additional documentation for the tagged operations. */
|
|
98
132
|
externalDocs?: OpenAPI3ExternalDocs;
|
|
99
133
|
}
|
|
134
|
+
/** HTTP method fields available on OpenAPI 3.0 and 3.1 Path Item Objects. */
|
|
100
135
|
export type OpenAPI3HttpMethod = "get" | "put" | "post" | "delete" | "options" | "head" | "patch" | "trace";
|
|
136
|
+
/** Named method fields in OpenAPI 3.2, adding `query` to the methods supported in earlier versions. */
|
|
101
137
|
export type OpenAPIHttpMethod3_2 = OpenAPI3HttpMethod | "query";
|
|
138
|
+
/** Named HTTP method fields supported across versions; does not include arbitrary 3.2 `additionalOperations` keys. */
|
|
102
139
|
export type HttpMethod = OpenAPI3HttpMethod | OpenAPIHttpMethod3_2;
|
|
103
140
|
/**
|
|
104
141
|
* Describes the operations available on a single path. A Path Item may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
|
|
@@ -108,22 +145,39 @@ export type HttpMethod = OpenAPI3HttpMethod | OpenAPIHttpMethod3_2;
|
|
|
108
145
|
export type OpenAPI3PathItem = {
|
|
109
146
|
[method in OpenAPI3HttpMethod]?: OpenAPI3Operation;
|
|
110
147
|
} & {
|
|
148
|
+
/** Parameters shared by every operation on this path; operations can override matching name/location pairs. */
|
|
111
149
|
parameters?: OpenAPI3Parameter[];
|
|
112
150
|
} & Extensions;
|
|
151
|
+
/** Reusable OpenAPI 3.0 definitions. A component has no effect until an operation or another definition references it. */
|
|
113
152
|
export interface OpenAPI3Components extends Extensions {
|
|
153
|
+
/** Named schemas addressed through `#/components/schemas/{name}`. */
|
|
114
154
|
schemas?: Record<string, OpenAPI3Schema>;
|
|
155
|
+
/**
|
|
156
|
+
* Reusable header definitions keyed by component name. The referencing response
|
|
157
|
+
* or encoding's `headers` map supplies the HTTP header name.
|
|
158
|
+
*/
|
|
115
159
|
headers?: Record<string, OpenAPI3Header>;
|
|
160
|
+
/** Reusable response descriptions, payloads and headers. */
|
|
116
161
|
responses?: Record<string, OpenAPI3Response>;
|
|
162
|
+
/** Reusable parameters, each retaining its own name and location. */
|
|
117
163
|
parameters?: Record<string, OpenAPI3Parameter>;
|
|
164
|
+
/** Named examples that media types or parameters can reference. */
|
|
118
165
|
examples?: Record<string, OpenAPI3Example>;
|
|
166
|
+
/** Reusable request payload descriptions and media types. */
|
|
119
167
|
requestBodies?: Record<string, OpenAPI3RequestBody>;
|
|
168
|
+
/** Authentication definitions selected by name in security requirements. */
|
|
120
169
|
securitySchemes?: Record<string, OpenAPI3SecurityScheme>;
|
|
170
|
+
/** Named relationships from a response to another operation. */
|
|
121
171
|
links?: Record<string, OpenAPI3Link>;
|
|
122
172
|
}
|
|
173
|
+
/** Response map key: an HTTP status code, a status-code range such as `2XX`, or the `default` fallback. */
|
|
123
174
|
export type OpenAPI3StatusCode = string | "default" | "1XX" | "2XX" | "3XX" | "4XX" | "5XX";
|
|
175
|
+
/** Responses for an operation, keyed by status; an explicit code takes precedence over a range. */
|
|
124
176
|
export type OpenAPI3Responses = {
|
|
177
|
+
/** Response definition or reference for a status code, range, or `default`. */
|
|
125
178
|
[status: OpenAPI3StatusCode]: Refable<OpenAPI3Response>;
|
|
126
179
|
} & Extensions;
|
|
180
|
+
/** One possible operation response, independent of the status key under which it is used. */
|
|
127
181
|
export type OpenAPI3Response = Extensions & {
|
|
128
182
|
/** A short description of the response. CommonMark syntax MAY be used for rich text representation. */
|
|
129
183
|
description: string;
|
|
@@ -179,6 +233,7 @@ export type OpenAPI3RequestBody = Extensions & {
|
|
|
179
233
|
/** Determines if the request body is required in the request. Defaults to false. */
|
|
180
234
|
required?: boolean;
|
|
181
235
|
};
|
|
236
|
+
/** Authentication scheme definitions referenced by name from document or operation security requirements. */
|
|
182
237
|
export type OpenAPI3SecurityScheme = OpenAPI3ApiKeySecurityScheme | OpenAPI3OAuth2SecurityScheme | OpenAPI3OpenIdConnectSecurityScheme | OpenAPI3HttpSecurityScheme;
|
|
183
238
|
/**
|
|
184
239
|
* defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect Discovery.
|
|
@@ -215,6 +270,7 @@ export interface OpenAPI3HttpSecurityScheme extends OpenAPI3SecuritySchemeBase {
|
|
|
215
270
|
* defines an OAuth2 security scheme that can be used by the operations
|
|
216
271
|
*/
|
|
217
272
|
export interface OpenAPI3OAuth2SecurityScheme extends OpenAPI3SecuritySchemeBase {
|
|
273
|
+
/** Selects OAuth 2.0 authentication; the supported grant types are described in `flows`. */
|
|
218
274
|
type: "oauth2";
|
|
219
275
|
/** An object containing configuration information for the flow types supported. */
|
|
220
276
|
flows: OpenAPI3OAuthFlows;
|
|
@@ -270,6 +326,7 @@ export interface OpenAPI3OpenIdConnectSecurityScheme extends OpenAPI3SecuritySch
|
|
|
270
326
|
/** OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL. */
|
|
271
327
|
openIdConnectUrl: string;
|
|
272
328
|
}
|
|
329
|
+
/** Identifies a related operation by either a reference or an operation ID, but not both. */
|
|
273
330
|
export type OpenAPI3Link = {
|
|
274
331
|
/** A relative or absolute reference to an OAS operation. This field is mutually exclusive of the operationId field, and MUST point to an Operation Object. Relative operationRef values MAY be used to locate an existing Operation Object in the OpenAPI definition. */
|
|
275
332
|
operationRef: Ref<unknown>;
|
|
@@ -278,20 +335,28 @@ export type OpenAPI3Link = {
|
|
|
278
335
|
operationId: string;
|
|
279
336
|
};
|
|
280
337
|
/**
|
|
281
|
-
*
|
|
338
|
+
* A reusable parameter or payload example, supplied inline or by an external URL.
|
|
282
339
|
*
|
|
283
|
-
* @see https://spec.openapis.org/oas/
|
|
340
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#example-object
|
|
284
341
|
*/
|
|
285
342
|
export interface OpenAPI3Example {
|
|
343
|
+
/** Short label that distinguishes this example from others. */
|
|
286
344
|
summary?: string;
|
|
345
|
+
/** Explanation of the example, which may use CommonMark. */
|
|
287
346
|
description?: string;
|
|
347
|
+
/** Inline example data; mutually exclusive with `externalValue`. */
|
|
288
348
|
value?: unknown;
|
|
349
|
+
/** URL of example data that cannot be included inline; mutually exclusive with `value`. */
|
|
289
350
|
externalValue?: string;
|
|
290
351
|
}
|
|
352
|
+
/** Selects among alternative payload schemas using a property value; does not replace schema validation. */
|
|
291
353
|
export interface OpenAPI3Discriminator extends Extensions {
|
|
354
|
+
/** Payload property whose value identifies the applicable schema. */
|
|
292
355
|
propertyName: string;
|
|
356
|
+
/** Explicit mapping from discriminator values to schema names or references. */
|
|
293
357
|
mapping?: Record<string, string>;
|
|
294
358
|
}
|
|
359
|
+
/** OpenAPI 3.2 discriminator metadata, including a fallback for missing or unmapped discriminator values. */
|
|
295
360
|
export interface OpenAPIDiscriminator3_2 extends OpenAPI3Discriminator {
|
|
296
361
|
/**
|
|
297
362
|
* The default mapping value to be used when no other mapping matches.
|
|
@@ -299,14 +364,26 @@ export interface OpenAPIDiscriminator3_2 extends OpenAPI3Discriminator {
|
|
|
299
364
|
*/
|
|
300
365
|
defaultMapping?: string;
|
|
301
366
|
}
|
|
367
|
+
/** Single-type values for OpenAPI 3.0 schemas; nullability is expressed separately with `nullable`. */
|
|
302
368
|
export type JsonType = "array" | "boolean" | "integer" | "number" | "object" | "string";
|
|
369
|
+
/** XML serialization metadata for a schema, separate from its JSON property names and structure. */
|
|
303
370
|
export type OpenAPI3XmlSchema = Extensions & {
|
|
371
|
+
/** Overrides the XML element or attribute name. */
|
|
304
372
|
name?: string;
|
|
373
|
+
/** Absolute URI identifying the XML namespace. */
|
|
305
374
|
namespace?: string;
|
|
375
|
+
/** Namespace prefix used in the XML representation. */
|
|
306
376
|
prefix?: string;
|
|
377
|
+
/** Serializes this property as an XML attribute instead of an element; defaults to false. */
|
|
307
378
|
attribute?: boolean;
|
|
379
|
+
/** Wraps array item elements in a container element; only applies to arrays and defaults to false. */
|
|
308
380
|
wrapped?: boolean;
|
|
309
381
|
};
|
|
382
|
+
/**
|
|
383
|
+
* Schema shape used for OpenAPI 3.0, whose vocabulary differs from the JSON
|
|
384
|
+
* Schema-based 3.1 and 3.2 shapes. For example, exclusive bounds are booleans
|
|
385
|
+
* modifying `minimum`/`maximum`, and nullability uses `nullable`.
|
|
386
|
+
*/
|
|
310
387
|
export type OpenAPI3Schema = Extensions & {
|
|
311
388
|
/**
|
|
312
389
|
* This attribute is a string that provides a short description of the instance property.
|
|
@@ -327,9 +404,9 @@ export type OpenAPI3Schema = Extensions & {
|
|
|
327
404
|
*/
|
|
328
405
|
maximum?: number;
|
|
329
406
|
/**
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
* @see https://
|
|
407
|
+
* When true, `maximum` is an exclusive bound; otherwise it is inclusive.
|
|
408
|
+
* Unlike OpenAPI 3.1 and later, this field is not itself a numeric bound.
|
|
409
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#schema-object
|
|
333
410
|
*/
|
|
334
411
|
exclusiveMaximum?: boolean;
|
|
335
412
|
/**
|
|
@@ -339,9 +416,9 @@ export type OpenAPI3Schema = Extensions & {
|
|
|
339
416
|
*/
|
|
340
417
|
minimum?: number;
|
|
341
418
|
/**
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
* @see https://
|
|
419
|
+
* When true, `minimum` is an exclusive bound; otherwise it is inclusive.
|
|
420
|
+
* Unlike OpenAPI 3.1 and later, this field is not itself a numeric bound.
|
|
421
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#schema-object
|
|
345
422
|
*/
|
|
346
423
|
exclusiveMinimum?: boolean;
|
|
347
424
|
/**
|
|
@@ -480,7 +557,7 @@ export type OpenAPI3Schema = Extensions & {
|
|
|
480
557
|
* @note "default" has no meaning for required parameters.) See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. Unlike JSON Schema this value MUST conform to the defined type for this parameter.
|
|
481
558
|
*/
|
|
482
559
|
default?: string | boolean | number | Record<string, any>;
|
|
483
|
-
/** Allows
|
|
560
|
+
/** Allows null in addition to an explicitly specified `type`; defaults to false. OpenAPI 3.1 and later use the `"null"` type instead. */
|
|
484
561
|
nullable?: boolean;
|
|
485
562
|
/**
|
|
486
563
|
* Property is readonly.
|
|
@@ -501,6 +578,7 @@ export type OpenAPI3Schema = Extensions & {
|
|
|
501
578
|
/** This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */
|
|
502
579
|
xml?: OpenAPI3XmlSchema;
|
|
503
580
|
};
|
|
581
|
+
/** Shared parameter and header fields. Use either `schema` with serialization fields or single-entry `content`, not both. */
|
|
504
582
|
export type OpenAPI3ParameterBase = Extensions & {
|
|
505
583
|
/**A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
|
|
506
584
|
description?: string;
|
|
@@ -510,16 +588,20 @@ export type OpenAPI3ParameterBase = Extensions & {
|
|
|
510
588
|
deprecated?: boolean;
|
|
511
589
|
/** When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When style is form, the default value is true. For all other styles, the default value is false. */
|
|
512
590
|
explode?: boolean;
|
|
591
|
+
/** Value schema for style-based serialization; mutually exclusive with `content`. */
|
|
513
592
|
schema?: Refable<OpenAPI3Schema>;
|
|
514
593
|
/** A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary. */
|
|
515
594
|
example?: any;
|
|
595
|
+
/** Named examples or references; mutually exclusive with `example` and overriding schema-level examples. */
|
|
516
596
|
examples?: Record<string, Refable<OpenAPI3Example>>;
|
|
517
597
|
/** A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry. */
|
|
518
598
|
content?: Record<string, OpenAPI3MediaType>;
|
|
519
599
|
};
|
|
600
|
+
/** One named URL query parameter; `style` and `explode` describe its serialization. */
|
|
520
601
|
export type OpenAPI3QueryParameter = OpenAPI3ParameterBase & {
|
|
521
602
|
/** Name of the parameter. */
|
|
522
603
|
name: string;
|
|
604
|
+
/** Selects an individual query parameter, not the entire query string. */
|
|
523
605
|
in: "query";
|
|
524
606
|
/**
|
|
525
607
|
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
@@ -529,9 +611,11 @@ export type OpenAPI3QueryParameter = OpenAPI3ParameterBase & {
|
|
|
529
611
|
*/
|
|
530
612
|
style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject";
|
|
531
613
|
};
|
|
614
|
+
/** A path-template substitution. Its name must match a placeholder and `required` must be true. */
|
|
532
615
|
export type OpenAPI3PathParameter = OpenAPI3ParameterBase & {
|
|
533
616
|
/** Name of the parameter. */
|
|
534
617
|
name: string;
|
|
618
|
+
/** Selects a URL path-template parameter. */
|
|
535
619
|
in: "path";
|
|
536
620
|
/**
|
|
537
621
|
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
@@ -541,9 +625,11 @@ export type OpenAPI3PathParameter = OpenAPI3ParameterBase & {
|
|
|
541
625
|
*/
|
|
542
626
|
style?: "simple" | "label" | "matrix";
|
|
543
627
|
};
|
|
628
|
+
/** A named HTTP request header; header names are case-insensitive. */
|
|
544
629
|
export type OpenAPI3HeaderParameter = OpenAPI3ParameterBase & {
|
|
545
630
|
/** Name of the parameter. */
|
|
546
631
|
name: string;
|
|
632
|
+
/** Selects a request header, rather than a response Header Object. */
|
|
547
633
|
in: "header";
|
|
548
634
|
/**
|
|
549
635
|
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
@@ -553,19 +639,23 @@ export type OpenAPI3HeaderParameter = OpenAPI3ParameterBase & {
|
|
|
553
639
|
*/
|
|
554
640
|
style?: "simple";
|
|
555
641
|
};
|
|
642
|
+
/** A named request cookie, using form-style serialization in OpenAPI 3.0. */
|
|
556
643
|
export type OpenAPI3CookieParameter = OpenAPI3ParameterBase & {
|
|
557
644
|
/** Name of the parameter. */
|
|
558
645
|
name: string;
|
|
646
|
+
/** Selects a cookie carried in the request. */
|
|
559
647
|
in: "cookie";
|
|
560
648
|
/**
|
|
561
649
|
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
562
650
|
*
|
|
563
|
-
* Default value for
|
|
651
|
+
* Default value for cookie parameters is form.
|
|
564
652
|
* @see https://spec.openapis.org/oas/v3.0.4.html#style-values
|
|
565
653
|
*/
|
|
566
654
|
style?: "form";
|
|
567
655
|
};
|
|
656
|
+
/** A request parameter discriminated by `in`; a parameter's identity is its name/location pair. */
|
|
568
657
|
export type OpenAPI3Parameter = OpenAPI3HeaderParameter | OpenAPI3QueryParameter | OpenAPI3PathParameter | OpenAPI3CookieParameter;
|
|
658
|
+
/** Supported named parameter locations, excluding request bodies. */
|
|
569
659
|
export type OpenAPI3ParameterType = OpenAPI3Parameter["in"];
|
|
570
660
|
/**
|
|
571
661
|
* The Header Object follows the structure of the Parameter Object with the following changes:
|
|
@@ -583,24 +673,52 @@ export type OpenAPI3Header = OpenAPI3ParameterBase & {
|
|
|
583
673
|
*/
|
|
584
674
|
style?: "simple";
|
|
585
675
|
};
|
|
676
|
+
/** An operation attached to an HTTP method on a path, with its inputs, responses and security overrides. */
|
|
586
677
|
export type OpenAPI3Operation = Extensions & {
|
|
678
|
+
/** Detailed explanation of the operation, which may use CommonMark. */
|
|
587
679
|
description?: string;
|
|
680
|
+
/** Short explanation suitable for operation lists. */
|
|
588
681
|
summary?: string;
|
|
682
|
+
/** Possible responses, including status-specific entries and an optional default. */
|
|
589
683
|
responses?: Refable<OpenAPI3Responses>;
|
|
684
|
+
/** Tag names used to group this operation; document-level tag metadata is optional. */
|
|
590
685
|
tags?: string[];
|
|
686
|
+
/** Identifier that must be unique among operations in the API. */
|
|
591
687
|
operationId?: string;
|
|
688
|
+
/** Payload accepted by this operation, separate from path, query, header and cookie parameters. */
|
|
592
689
|
requestBody?: Refable<OpenAPI3RequestBody>;
|
|
690
|
+
/** Operation parameters; matching name/location pairs override path-level parameters. */
|
|
593
691
|
parameters: Refable<OpenAPI3Parameter>[];
|
|
692
|
+
/** Marks an operation that consumers should stop using; absence means false. */
|
|
594
693
|
deprecated?: boolean;
|
|
694
|
+
/**
|
|
695
|
+
* Overrides document-level security. Entries are alternatives; schemes within
|
|
696
|
+
* an entry are all required. An empty array removes inherited requirements.
|
|
697
|
+
*/
|
|
595
698
|
security?: Record<string, string[]>[];
|
|
596
699
|
};
|
|
700
|
+
/**
|
|
701
|
+
* A reference to a definition of `T`, which is not resolved or validated by this type.
|
|
702
|
+
* `summary` and `description` siblings are supported on Reference Objects in OpenAPI 3.1 and later.
|
|
703
|
+
*/
|
|
597
704
|
export interface Ref<T> {
|
|
705
|
+
/** URI reference locating the target, often a document-local `#/components/...` JSON Pointer. */
|
|
598
706
|
$ref: string;
|
|
707
|
+
/** Description override where supported by the referring object and OpenAPI version. */
|
|
599
708
|
description?: string;
|
|
709
|
+
/** Summary override where supported by the referring object and OpenAPI version. */
|
|
600
710
|
summary?: string;
|
|
601
711
|
}
|
|
712
|
+
/** A definition embedded inline or supplied by a `$ref`; check for `$ref` before accessing definition fields. */
|
|
602
713
|
export type Refable<T> = Ref<T> | T;
|
|
714
|
+
/** JSON Schema type names, including `"null"` for the schema vocabulary used in OpenAPI 3.1 and later. */
|
|
603
715
|
export type JsonSchemaType = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string";
|
|
716
|
+
/**
|
|
717
|
+
* JSON Schema 2020-12 keywords modeled by this package for OpenAPI 3.1 and later.
|
|
718
|
+
* Unlike the 3.0 shape, supports type arrays, numeric exclusive bounds and tuple prefixes.
|
|
719
|
+
*
|
|
720
|
+
* @template AdditionalVocabularies Extra keyword fields, also available on recursively nested schemas.
|
|
721
|
+
*/
|
|
604
722
|
export type JsonSchema<AdditionalVocabularies extends {} = {}> = AdditionalVocabularies & {
|
|
605
723
|
/**
|
|
606
724
|
* The JSON type for the schema.
|
|
@@ -885,6 +1003,7 @@ export type JsonSchema<AdditionalVocabularies extends {} = {}> = AdditionalVocab
|
|
|
885
1003
|
/** Additional external documentation for this schema. */
|
|
886
1004
|
externalDocs?: OpenAPI3ExternalDocs;
|
|
887
1005
|
};
|
|
1006
|
+
/** OpenAPI 3.1 schema vocabulary: JSON Schema 2020-12 keywords plus OpenAPI metadata and vendor extensions. */
|
|
888
1007
|
export type OpenAPISchema3_1 = JsonSchema<{
|
|
889
1008
|
/**
|
|
890
1009
|
* Adds support for polymorphism.
|
|
@@ -906,7 +1025,9 @@ export type OpenAPISchema3_1 = JsonSchema<{
|
|
|
906
1025
|
*/
|
|
907
1026
|
xml?: OpenAPI3XmlSchema;
|
|
908
1027
|
} & Extensions>;
|
|
1028
|
+
/** An OpenAPI 3.1 document, introducing JSON Schema-based schemas, webhooks and reusable path items. */
|
|
909
1029
|
export interface OpenAPIDocument3_1 extends Extensions {
|
|
1030
|
+
/** OpenAPI specification version; `info.version` separately identifies the API version. */
|
|
910
1031
|
openapi: "3.1.0";
|
|
911
1032
|
/**
|
|
912
1033
|
* Provides metadata about the API. The metadata can be used by the clients if needed.
|
|
@@ -948,19 +1069,32 @@ export interface OpenAPIDocument3_1 extends Extensions {
|
|
|
948
1069
|
*/
|
|
949
1070
|
security?: Record<string, string[]>[];
|
|
950
1071
|
}
|
|
1072
|
+
/** Reusable OpenAPI 3.1 definitions, including callbacks and path items not modeled in the 3.0 component shape. */
|
|
951
1073
|
export interface OpenAPIComponents3_1 extends Extensions {
|
|
1074
|
+
/** Named schemas using the 3.1 JSON Schema vocabulary rather than the 3.0 schema subset. */
|
|
952
1075
|
schemas?: Record<string, OpenAPISchema3_1>;
|
|
1076
|
+
/** Response definitions or aliases, referenced from an operation's response map. */
|
|
953
1077
|
responses?: Record<string, Refable<OpenAPI3Response>>;
|
|
1078
|
+
/** Parameter definitions or aliases; each definition supplies its own name and location. */
|
|
954
1079
|
parameters?: Record<string, Refable<OpenAPI3Parameter>>;
|
|
1080
|
+
/** Named examples for reuse by parameters or media types. */
|
|
955
1081
|
examples?: Record<string, Refable<OpenAPI3Example>>;
|
|
1082
|
+
/** Request body definitions or aliases, separate from named parameters. */
|
|
956
1083
|
requestBodies?: Record<string, Refable<OpenAPI3RequestBody>>;
|
|
1084
|
+
/** Header definitions or aliases; usage sites supply the header name. */
|
|
957
1085
|
headers?: Record<string, Refable<OpenAPI3Header>>;
|
|
1086
|
+
/** Authentication definitions selected by name in security requirements. */
|
|
958
1087
|
securitySchemes?: Record<string, Refable<OpenAPI3SecurityScheme>>;
|
|
1088
|
+
/** Reusable relationships from a response to another operation. */
|
|
959
1089
|
links?: Record<string, Refable<OpenAPI3Link>>;
|
|
1090
|
+
/** Named callbacks mapping runtime URL expressions to the requests the API may initiate. */
|
|
960
1091
|
callbacks?: Record<string, Record<string, OpenAPI3PathItem>>;
|
|
1092
|
+
/** Named path definitions reusable independently of a concrete URL path. */
|
|
961
1093
|
pathItems?: Record<string, OpenAPI3PathItem>;
|
|
962
1094
|
}
|
|
1095
|
+
/** OpenAPI 3.2 document shape, replacing version-sensitive 3.1 fields with their 3.2 counterparts. */
|
|
963
1096
|
export interface OpenAPIDocument3_2 extends Omit<OpenAPIDocument3_1, "openapi" | "servers" | "components" | "webhooks" | "paths" | "tags"> {
|
|
1097
|
+
/** OpenAPI specification version; `info.version` separately identifies the API version. */
|
|
964
1098
|
openapi: "3.2.0";
|
|
965
1099
|
/**
|
|
966
1100
|
* This string MUST be in the form of a URI reference as defined.
|
|
@@ -990,6 +1124,7 @@ export interface OpenAPIDocument3_2 extends Omit<OpenAPIDocument3_1, "openapi" |
|
|
|
990
1124
|
/** An element to hold various schemas for the specification. */
|
|
991
1125
|
components?: OpenAPIComponents3_2;
|
|
992
1126
|
}
|
|
1127
|
+
/** A server endpoint with the optional stable name introduced in OpenAPI 3.2. */
|
|
993
1128
|
export interface OpenAPIServer3_2 extends OpenAPI3Server {
|
|
994
1129
|
/**
|
|
995
1130
|
* An optional unique string to refer to the host designated by the URL.
|
|
@@ -997,6 +1132,7 @@ export interface OpenAPIServer3_2 extends OpenAPI3Server {
|
|
|
997
1132
|
*/
|
|
998
1133
|
name?: string;
|
|
999
1134
|
}
|
|
1135
|
+
/** OpenAPI 3.2 encoding metadata supporting nested multipart structures and positional array encodings. */
|
|
1000
1136
|
export interface OpenAPIEncoding3_2 extends OpenAPI3Encoding {
|
|
1001
1137
|
/**
|
|
1002
1138
|
* Applies nested Encoding Objects in the same manner as the {@link OpenAPIMediaType3_2.encoding} field
|
|
@@ -1014,6 +1150,7 @@ export interface OpenAPIEncoding3_2 extends OpenAPI3Encoding {
|
|
|
1014
1150
|
*/
|
|
1015
1151
|
itemEncoding?: OpenAPIEncoding3_2;
|
|
1016
1152
|
}
|
|
1153
|
+
/** OpenAPI 3.2 media representation, with stream item schemas and nested or positional encodings. */
|
|
1017
1154
|
export interface OpenAPIMediaType3_2 extends Omit<OpenAPI3MediaType, "examples" | "schema"> {
|
|
1018
1155
|
/** The schema defining the content of the request, response, or parameter. */
|
|
1019
1156
|
schema?: Refable<OpenAPISchema3_2>;
|
|
@@ -1041,6 +1178,7 @@ export interface OpenAPIMediaType3_2 extends Omit<OpenAPI3MediaType, "examples"
|
|
|
1041
1178
|
/** Examples with title */
|
|
1042
1179
|
examples?: Record<string, Refable<OpenAPIExample3_2>>;
|
|
1043
1180
|
}
|
|
1181
|
+
/** Reusable OpenAPI 3.2 definitions, adding media type components and version-specific referenced objects. */
|
|
1044
1182
|
export interface OpenAPIComponents3_2 extends Omit<OpenAPIComponents3_1, "responses" | "securitySchemes" | "examples" | "schemas" | "callbacks" | "pathItems" | "parameters" | "requestBodies"> {
|
|
1045
1183
|
/**
|
|
1046
1184
|
* An object to hold reusable {@link OpenAPIMediaType3_2} objects
|
|
@@ -1088,9 +1226,12 @@ export interface OpenAPIComponents3_2 extends Omit<OpenAPIComponents3_1, "respon
|
|
|
1088
1226
|
*/
|
|
1089
1227
|
parameters?: Record<string, Refable<OpenAPIParameter3_2>>;
|
|
1090
1228
|
}
|
|
1229
|
+
/** OpenAPI 3.2 operation responses keyed by status code, range, or the `default` fallback. */
|
|
1091
1230
|
export type OpenAPIResponses3_2 = {
|
|
1231
|
+
/** Response or reference for the corresponding status, with 3.2 media type support. */
|
|
1092
1232
|
[status: OpenAPI3StatusCode]: Refable<OpenAPIResponse3_2>;
|
|
1093
1233
|
} & Extensions;
|
|
1234
|
+
/** OpenAPI 3.2 response, allowing a short summary and references to reusable media types. */
|
|
1094
1235
|
export interface OpenAPIResponse3_2 extends Omit<OpenAPI3Response, "content"> {
|
|
1095
1236
|
/** A map containing descriptions of potential response payloads. The key is a media type or 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/* */
|
|
1096
1237
|
content?: Record<string, Refable<OpenAPIMediaType3_2>>;
|
|
@@ -1100,6 +1241,7 @@ export interface OpenAPIResponse3_2 extends Omit<OpenAPI3Response, "content"> {
|
|
|
1100
1241
|
*/
|
|
1101
1242
|
summary?: string;
|
|
1102
1243
|
}
|
|
1244
|
+
/** Shared security scheme metadata with the deprecation flag introduced in OpenAPI 3.2. */
|
|
1103
1245
|
export interface OpenAPISecuritySchemeBase3_2 extends OpenAPI3SecuritySchemeBase {
|
|
1104
1246
|
/**
|
|
1105
1247
|
* Specifies that a security scheme is deprecated and SHOULD be transitioned out of usage.
|
|
@@ -1108,18 +1250,23 @@ export interface OpenAPISecuritySchemeBase3_2 extends OpenAPI3SecuritySchemeBase
|
|
|
1108
1250
|
*/
|
|
1109
1251
|
deprecated?: boolean;
|
|
1110
1252
|
}
|
|
1253
|
+
/** API key authentication in OpenAPI 3.2, retaining the key name/location and adding deprecation metadata. */
|
|
1111
1254
|
export interface OpenAPIApiKeySecurityScheme3_2 extends OpenAPISecuritySchemeBase3_2, OpenAPI3ApiKeySecurityScheme {
|
|
1112
1255
|
}
|
|
1256
|
+
/** OAuth 2.0 authentication in OpenAPI 3.2, including optional device authorization flow configuration. */
|
|
1113
1257
|
export interface OpenAPIOAuth2SecurityScheme3_2 extends OpenAPISecuritySchemeBase3_2, Omit<OpenAPI3OAuth2SecurityScheme, "flows"> {
|
|
1114
1258
|
/** An object containing configuration information for the flow types supported. */
|
|
1115
1259
|
flows: OpenAPIOAuthFlows3_2;
|
|
1116
1260
|
}
|
|
1261
|
+
/** OpenID Connect discovery in OpenAPI 3.2, with optional security scheme deprecation metadata. */
|
|
1117
1262
|
export interface OpenAPIOpenIdConnectSecurityScheme3_2 extends OpenAPISecuritySchemeBase3_2, OpenAPI3OpenIdConnectSecurityScheme {
|
|
1118
1263
|
}
|
|
1264
|
+
/** HTTP authentication in OpenAPI 3.2, with optional security scheme deprecation metadata. */
|
|
1119
1265
|
export interface OpenAPIHttpSecurityScheme3_2 extends OpenAPISecuritySchemeBase3_2, OpenAPI3HttpSecurityScheme {
|
|
1120
1266
|
}
|
|
1267
|
+
/** Authentication scheme shapes modeled for OpenAPI 3.2, selected by their `type` field. */
|
|
1121
1268
|
export type OpenAPISecurityScheme3_2 = OpenAPIApiKeySecurityScheme3_2 | OpenAPIOAuth2SecurityScheme3_2 | OpenAPIOpenIdConnectSecurityScheme3_2 | OpenAPIHttpSecurityScheme3_2;
|
|
1122
|
-
/**
|
|
1269
|
+
/** OAuth 2.0 Device Authorization Grant endpoints and scopes, supported starting in OpenAPI 3.2. */
|
|
1123
1270
|
export interface OpenAPIDeviceAuthorizationFlow3_2 extends OpenAPI3OAuth2Flow {
|
|
1124
1271
|
/** The token URL to be used for this flow. This MUST be in the form of a URL. */
|
|
1125
1272
|
tokenUrl: string;
|
|
@@ -1158,6 +1305,7 @@ export interface OpenAPIExample3_2 extends OpenAPI3Example {
|
|
|
1158
1305
|
*/
|
|
1159
1306
|
serializedValue?: string;
|
|
1160
1307
|
}
|
|
1308
|
+
/** OpenAPI 3.2 schema vocabulary, extending the JSON Schema-based shape with 3.2 XML and discriminator metadata. */
|
|
1161
1309
|
export type OpenAPISchema3_2 = JsonSchema<{
|
|
1162
1310
|
/**
|
|
1163
1311
|
* Adds additional metadata to describe the XML representation of this property.
|
|
@@ -1165,7 +1313,7 @@ export type OpenAPISchema3_2 = JsonSchema<{
|
|
|
1165
1313
|
*/
|
|
1166
1314
|
xml?: OpenAPIXmlSchema3_2;
|
|
1167
1315
|
/**
|
|
1168
|
-
*
|
|
1316
|
+
* Selects a payload schema by discriminator value, with an optional fallback for missing or unmapped values.
|
|
1169
1317
|
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-20
|
|
1170
1318
|
*/
|
|
1171
1319
|
discriminator?: OpenAPIDiscriminator3_2;
|
|
@@ -1176,25 +1324,32 @@ export type OpenAPISchema3_2 = JsonSchema<{
|
|
|
1176
1324
|
*/
|
|
1177
1325
|
externalDocs?: OpenAPI3ExternalDocs;
|
|
1178
1326
|
} & Extensions>;
|
|
1327
|
+
/** OpenAPI 3.2 XML metadata, using `nodeType` in place of the legacy attribute and array-wrapper flags. */
|
|
1179
1328
|
export interface OpenAPIXmlSchema3_2 extends Omit<OpenAPI3XmlSchema, "attribute" | "wrapped"> {
|
|
1180
1329
|
/**
|
|
1330
|
+
* Legacy switch for serializing a property as an attribute; must not accompany `nodeType`.
|
|
1181
1331
|
* @deprecated This property is deprecated and SHOULD be replaced by the {@link nodeType} property.
|
|
1182
1332
|
*/
|
|
1183
1333
|
attribute?: boolean;
|
|
1184
1334
|
/**
|
|
1335
|
+
* Legacy array-wrapper switch; must not accompany `nodeType`.
|
|
1185
1336
|
* @deprecated This property is deprecated and SHOULD be replaced by the {@link nodeType} property.
|
|
1186
1337
|
*/
|
|
1187
1338
|
wrapped?: boolean;
|
|
1188
1339
|
/**
|
|
1189
|
-
* The type of the XML DOM node.
|
|
1340
|
+
* The type of the XML DOM node. Defaults to `"none"` for arrays or reference
|
|
1341
|
+
* schemas, and `"element"` otherwise.
|
|
1190
1342
|
* @see https://spec.openapis.org/oas/v3.2.0.html#xml-node-types
|
|
1191
|
-
* @default "none"
|
|
1192
1343
|
*/
|
|
1193
1344
|
nodeType?: "element" | "attribute" | "text" | "cdata" | "comment" | "none";
|
|
1194
1345
|
}
|
|
1346
|
+
/** OpenAPI 3.2 operation using version-specific parameters, responses and request media types. */
|
|
1195
1347
|
export type OpenAPIOperation3_2 = Omit<OpenAPI3Operation, "responses" | "parameters" | "requestBody"> & {
|
|
1348
|
+
/** Status-keyed responses using the 3.2 response shape. */
|
|
1196
1349
|
responses?: Refable<OpenAPIResponses3_2>;
|
|
1350
|
+
/** Operation-specific parameters, overriding path-level parameters with the same name/location pair. */
|
|
1197
1351
|
parameters?: Refable<OpenAPIParameter3_2>[];
|
|
1352
|
+
/** Request payload with support for reusable media type definitions. */
|
|
1198
1353
|
requestBody?: Refable<OpenAPIRequestBody3_2>;
|
|
1199
1354
|
};
|
|
1200
1355
|
/**
|
|
@@ -1205,34 +1360,57 @@ export type OpenAPIOperation3_2 = Omit<OpenAPI3Operation, "responses" | "paramet
|
|
|
1205
1360
|
export type OpenAPIPathItem3_2 = Omit<OpenAPI3PathItem, OpenAPI3HttpMethod | "parameters"> & {
|
|
1206
1361
|
[method in OpenAPIHttpMethod3_2]?: OpenAPIOperation3_2;
|
|
1207
1362
|
} & {
|
|
1363
|
+
/** Operations for HTTP methods without a named path-item field, keyed by case-sensitive method name. */
|
|
1208
1364
|
additionalOperations?: Record<string, OpenAPIOperation3_2>;
|
|
1365
|
+
/** Parameters shared by all operations on the path, subject to operation-level overrides. */
|
|
1209
1366
|
parameters?: Refable<OpenAPIParameter3_2>[];
|
|
1210
1367
|
};
|
|
1368
|
+
/** Shared OpenAPI 3.2 parameter fields, using version-specific schemas, examples and reusable media types. */
|
|
1211
1369
|
export type OpenAPIParameterBase3_2 = Omit<OpenAPI3ParameterBase, "content" | "examples" | "schema"> & {
|
|
1212
1370
|
/** A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry. */
|
|
1213
1371
|
content?: Record<string, Refable<OpenAPIMediaType3_2>>;
|
|
1372
|
+
/** Named data or serialized examples; mutually exclusive with `example`. */
|
|
1214
1373
|
examples?: Record<string, Refable<OpenAPIExample3_2>>;
|
|
1374
|
+
/** Value schema for style-based serialization; mutually exclusive with `content`. */
|
|
1215
1375
|
schema?: Refable<OpenAPISchema3_2>;
|
|
1216
1376
|
};
|
|
1377
|
+
/**
|
|
1378
|
+
* An OpenAPI 3.2 parameter describing the entire query string through `content`.
|
|
1379
|
+
* Must not coexist with individual `query` parameters for the same operation.
|
|
1380
|
+
*/
|
|
1217
1381
|
export type OpenAPIQueryStringParameter3_2 = Omit<OpenAPIParameterBase3_2, "style" | "explode" | "allowReserved" | "schema"> & {
|
|
1218
1382
|
/** Name of the parameter. */
|
|
1219
1383
|
name: string;
|
|
1384
|
+
/** Selects the entire query string rather than a single named query value. */
|
|
1220
1385
|
in: "querystring";
|
|
1221
1386
|
};
|
|
1387
|
+
/** OpenAPI 3.2 cookie parameter, adding cookie-specific serialization to the earlier form style. */
|
|
1222
1388
|
export type OpenAPICookieParameter3_2 = Omit<OpenAPI3CookieParameter, "content" | "examples" | "style"> & OpenAPIParameterBase3_2 & {
|
|
1223
1389
|
/**
|
|
1224
1390
|
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
1225
1391
|
*
|
|
1226
|
-
*
|
|
1392
|
+
* Defaults to form for compatibility; OpenAPI 3.2 recommends cookie style for cookie parameters.
|
|
1227
1393
|
* @see https://spec.openapis.org/oas/latest#fixed-fields-9
|
|
1228
1394
|
*/
|
|
1229
1395
|
style?: "form" | "cookie";
|
|
1230
1396
|
};
|
|
1397
|
+
/**
|
|
1398
|
+
* Request header parameter with OpenAPI 3.2 examples and media types.
|
|
1399
|
+
* Its exported schema type also retains the {@link OpenAPI3Schema} restriction, excluding type arrays.
|
|
1400
|
+
*/
|
|
1231
1401
|
export type OpenAPIHeaderParameter3_2 = Omit<OpenAPI3HeaderParameter, "content" | "examples"> & OpenAPIParameterBase3_2;
|
|
1402
|
+
/**
|
|
1403
|
+
* Required path-template parameter with OpenAPI 3.2 examples and media types.
|
|
1404
|
+
* Schema support is limited to the intersection of {@link OpenAPI3Schema} and {@link OpenAPISchema3_2}.
|
|
1405
|
+
*/
|
|
1232
1406
|
export type OpenAPIPathParameter3_2 = Omit<OpenAPI3PathParameter, "content" | "examples"> & OpenAPIParameterBase3_2;
|
|
1407
|
+
/** Individual named query parameter, distinct from the 3.2 whole-query-string parameter. */
|
|
1233
1408
|
export type OpenAPIQueryParameter3_2 = Omit<OpenAPI3QueryParameter, "content" | "examples"> & OpenAPIParameterBase3_2;
|
|
1409
|
+
/** OpenAPI 3.2 request parameter union, including the whole-query-string location added in this version. */
|
|
1234
1410
|
export type OpenAPIParameter3_2 = OpenAPIHeaderParameter3_2 | OpenAPIQueryParameter3_2 | OpenAPIQueryStringParameter3_2 | OpenAPIPathParameter3_2 | OpenAPICookieParameter3_2;
|
|
1411
|
+
/** Parameter locations modeled for OpenAPI 3.2, including `querystring` but excluding request bodies. */
|
|
1235
1412
|
export type OpenAPIParameterType3_2 = OpenAPIParameter3_2["in"];
|
|
1413
|
+
/** OpenAPI 3.2 tag metadata, supporting display summaries, parent-child organization and categorization. */
|
|
1236
1414
|
export interface OpenAPITag3_2 extends OpenAPI3Tag {
|
|
1237
1415
|
/**
|
|
1238
1416
|
* A short summary of the tag, used for display purposes.
|
|
@@ -1250,6 +1428,7 @@ export interface OpenAPITag3_2 extends OpenAPI3Tag {
|
|
|
1250
1428
|
*/
|
|
1251
1429
|
kind?: string;
|
|
1252
1430
|
}
|
|
1431
|
+
/** OpenAPI 3.2 request body, whose media representations can be embedded inline or referenced. */
|
|
1253
1432
|
export interface OpenAPIRequestBody3_2 extends Omit<OpenAPI3RequestBody, "content"> {
|
|
1254
1433
|
/** A map containing descriptions of potential request payloads. The key is a media type or 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/* */
|
|
1255
1434
|
content: Record<string, Refable<OpenAPIMediaType3_2>>;
|