@@ -17,7 +17,7 @@ import { ModuleKind, ScriptTarget } from "ts-morph";
1717
1818/**
1919 * License information for the exposed API.
20- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1 .0.md#licenseObject
20+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2 .0.md#licenseObject
2121 */
2222export interface LicenseObject {
2323 /** The license name used for the API. */
@@ -30,7 +30,7 @@ export interface LicenseObject {
3030
3131/**
3232 * Contact information for the exposed API.
33- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1 .0.md#contactObject
33+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2 .0.md#contactObject
3434 */
3535export interface ContactObject {
3636 /** The identifying name of the contact person/organization. */
@@ -43,7 +43,7 @@ export interface ContactObject {
4343
4444/**
4545 * The object provides metadata about the API.
46- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1 .0.md#infoObject
46+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2 .0.md#infoObject
4747 */
4848export interface InfoObject {
4949 /** The title of the API. */
@@ -62,6 +62,32 @@ export interface InfoObject {
6262 version : string ;
6363}
6464
65+ /**
66+ * Allows referencing an external resource for extended documentation.
67+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#externalDocumentationObject
68+ */
69+ export interface ExternalDocumentationObject {
70+ /** A description of the target documentation. */
71+ description ?: string ;
72+ /** The URL for the target documentation. */
73+ url : string ;
74+ }
75+
76+ /**
77+ * Adds metadata to a single tag that is used by the Operation Object.
78+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#tagObject
79+ */
80+ export interface TagObject {
81+ /** The name of the tag. */
82+ name : string ;
83+ /** A short summary of the tag. (OAS 3.1+) */
84+ summary ?: string ;
85+ /** A description for the tag. */
86+ description ?: string ;
87+ /** Additional external documentation for this tag. */
88+ externalDocs ?: ExternalDocumentationObject ;
89+ }
90+
6591/**
6692 * An object representing a Server Variable for server URL template substitution.
6793 * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#server-variable-object
@@ -100,7 +126,7 @@ export interface DiscriminatorObject {
100126
101127/**
102128 * Metadata object that allows for more fine-tuned XML model definitions.
103- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1 .0.md#xmlObject
129+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2 .0.md#xmlObject
104130 */
105131export interface XmlObject {
106132 /** Replaces the name of the element/attribute used for the described schema property. */
@@ -109,28 +135,26 @@ export interface XmlObject {
109135 namespace ?: string ;
110136 /** The prefix to be used for the name. */
111137 prefix ?: string ;
112- /** Declares whether the property definition translates to an attribute instead of an element. */
138+ /**
139+ * Declares whether the property definition translates to an attribute instead of an element.
140+ * @deprecated Use `nodeType: 'attribute'` instead.
141+ */
113142 attribute ?: boolean ;
114- /** MAY be used only for an array definition. Signifies whether the array is wrapped. */
143+ /**
144+ * MAY be used only for an array definition. Signifies whether the array is wrapped.
145+ * @deprecated Use `nodeType: 'element'` (on the array) for wrapping, partial/implicit 'none' for unwrapped.
146+ */
115147 wrapped ?: boolean ;
116- /** Node type for XML mapping (OpenAPI 3.2.0 / Extended spec). */
117- nodeType ?: string ;
118- }
119-
120- /**
121- * Allows referencing an external resource for extended documentation.
122- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#externalDocumentationObject
123- */
124- export interface ExternalDocumentationObject {
125- /** A description of the target documentation. */
126- description ?: string ;
127- /** The URL for the target documentation. */
128- url : string ;
148+ /**
149+ * Node type for XML mapping (OpenAPI 3.2.0).
150+ * Values: 'element' | 'attribute' | 'text' | 'cdata' | 'none'.
151+ */
152+ nodeType ?: 'element' | 'attribute' | 'text' | 'cdata' | 'none' | string ;
129153}
130154
131155/**
132156 * The Link Object represents a possible design-time link for a response.
133- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1 .0.md#linkObject
157+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2 .0.md#linkObject
134158 */
135159export interface LinkObject {
136160 /** A URI reference to an OAS operation. Mutually exclusive with operationId. */
@@ -151,7 +175,7 @@ export interface LinkObject {
151175 * The Header Object follows the structure of the Parameter Object with the following changes:
152176 * 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
153177 * 2. `in` MUST NOT be specified, it is implicitly in `header`.
154- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1 .0.md#headerObject
178+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2 .0.md#headerObject
155179 */
156180export interface HeaderObject {
157181 description ?: string ;
@@ -236,9 +260,9 @@ export interface PathInfo {
236260 /** Security requirements specific to this operation. keys are definitions, values are scopes. */
237261 security ?: { [ key : string ] : string [ ] } [ ] ;
238262 /** An alternate server array to service this operation. (OAS 3+) */
239- servers ?: ServerObject [ ] | undefined ; // Allow undefined explicit assignment
263+ servers ?: ServerObject [ ] | undefined ;
240264 /** A map of possible out-of band callbacks related to the parent operation. (OAS 3+) */
241- callbacks ?: Record < string , PathItem | { $ref : string } > | undefined ; // Allow undefined explicit assignment
265+ callbacks ?: Record < string , PathItem | { $ref : string } > ;
242266}
243267
244268/** A single encoding definition for a multipart property. */
@@ -282,20 +306,30 @@ export interface SwaggerResponse {
282306/**
283307 * A normalized and extended interface representing an OpenAPI Schema Object.
284308 * This is the core structure for defining data models.
309+ *
310+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#schemaObject
285311 */
286312export interface SwaggerDefinition {
287313 type ?: "string" | "number" | "integer" | "boolean" | "object" | "array" | "file" | "null" | ( "string" | "number" | "integer" | "boolean" | "object" | "array" | "null" ) [ ] ;
288314 format ?: string ;
289315 description ?: string ;
290316 default ?: unknown ;
317+ /** Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. */
318+ deprecated ?: boolean ;
291319 /** JSON Schema `const` keyword. (OAS 3.1 / JSON Schema 2020-12) */
292320 const ?: unknown ;
293321 maximum ?: number ;
294- /** If true, the `maximum` is exclusive. */
295- exclusiveMaximum ?: boolean ;
322+ /**
323+ * If boolean (OAS 3.0/Swagger 2): If true, `maximum` is exclusive.
324+ * If number (OAS 3.1+/JSON Schema 2020-12): The exclusive maximum value.
325+ */
326+ exclusiveMaximum ?: boolean | number ;
296327 minimum ?: number ;
297- /** If true, the `minimum` is exclusive. */
298- exclusiveMinimum ?: boolean ;
328+ /**
329+ * If boolean (OAS 3.0/Swagger 2): If true, `minimum` is exclusive.
330+ * If number (OAS 3.1+/JSON Schema 2020-12): The exclusive minimum value.
331+ */
332+ exclusiveMinimum ?: boolean | number ;
299333 maxLength ?: number ;
300334 minLength ?: number ;
301335 pattern ?: string ;
@@ -328,8 +362,15 @@ export interface SwaggerDefinition {
328362 writeOnly ?: boolean ;
329363 nullable ?: boolean ;
330364 required ?: string [ ] ;
331- /** An example of the schema representation. */
365+ /**
366+ * An example of the schema representation.
367+ * @deprecated exist in OAS 3.2 in favor of `examples`
368+ */
332369 example ?: unknown ;
370+ /**
371+ * Free-form field to include examples of instances for this schema. (OAS 3.1+)
372+ */
373+ examples ?: unknown [ ] ;
333374
334375 xml ?: XmlObject ;
335376 externalDocs ?: ExternalDocumentationObject ;
@@ -383,17 +424,30 @@ export interface PathItem {
383424 patch ?: SpecOperation ;
384425 trace ?: SpecOperation ;
385426 query ?: SpecOperation ; // OAS 3.2 draft
427+ /**
428+ * A map of additional operations on this path (OAS 3.2).
429+ * Keys are HTTP methods (e.g., COPY, LOCK).
430+ */
431+ additionalOperations ?: Record < string , SpecOperation > ;
386432 parameters ?: any [ ] ;
387433 servers ?: ServerObject [ ] ; // OAS 3 (Path-level override)
388434 [ key : string ] : any ;
389435}
390436
391- /** The root object of a parsed OpenAPI/Swagger specification. */
437+ /**
438+ * The root object of a parsed OpenAPI/Swagger specification.
439+ * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#oasObject
440+ */
392441export interface SwaggerSpec {
393442 openapi ?: string ;
394443 swagger ?: string ;
395444 $self ?: string ;
396445 info : InfoObject ;
446+ /** Additional external documentation. */
447+ externalDocs ?: ExternalDocumentationObject ;
448+ /** A list of tags used by the OpenAPI Description with additional metadata. */
449+ tags ?: TagObject [ ] ;
450+
397451 paths : { [ pathName : string ] : PathItem } ;
398452 /** The incoming webhooks that MAY be received as part of this API. */
399453 webhooks ?: { [ name : string ] : PathItem } ;
@@ -408,6 +462,7 @@ export interface SwaggerSpec {
408462 schemas ?: Record < string , SwaggerDefinition > ;
409463 securitySchemes ?: Record < string , SecurityScheme > ;
410464 pathItems ?: Record < string , PathItem > ;
465+ callbacks ?: Record < string , PathItem | { $ref : string } > ;
411466 links ?: Record < string , LinkObject | { $ref : string } > ;
412467 headers ?: Record < string , HeaderObject | { $ref : string } > ;
413468 } ;
0 commit comments