11import type { Json } from "@hyperjump/json-pointer" ;
22import type { JsonSchemaType } from "../lib/common.js" ;
33
4-
54export type OasSchema32 = boolean | {
65 $schema ?: "https://spec.openapis.org/oas/3.2/dialect/base" ;
76 $id ?: string ;
@@ -85,8 +84,7 @@ type Xml = {
8584 wrapped ?: boolean ;
8685} ;
8786
88- // TODO: Fill in this type when 3.2 is published
89- export type OpenApi32 = {
87+ export type OpenApi = {
9088 openapi : "3.2.0" ;
9189 info : {
9290 title : string ;
@@ -103,60 +101,60 @@ export type OpenApi32 = {
103101 url ?: string ;
104102 } ;
105103 } ;
106- servers ?: Array < { url : string ; description ?: string } > ;
107- paths ?: Record < string , PathItem32 > ;
108- webhooks ?: Record < string , PathItem32 > ; // <-- NEW in 3.2
109- components ?: Components32 ;
110- security ?: SecurityRequirement32 [ ] ;
111- tags ?: Tag32 [ ] ;
112- externalDocs ?: ExternalDocs32 ;
104+ servers ?: Server [ ] ;
105+ paths ?: Record < string , PathItem > ;
106+ webhooks ?: Record < string , PathItem > ;
107+ components ?: Components ;
108+ security ?: SecurityRequirement [ ] ;
109+ tags ?: Tag [ ] ;
110+ externalDocs ?: ExternalDocs ;
113111} ;
114112
115- export type PathItem32 = {
113+ export type PathItem = {
116114 summary ?: string ;
117115 description ?: string ;
118- get ?: Operation32 ;
119- put ?: Operation32 ;
120- post ?: Operation32 ;
121- delete ?: Operation32 ;
122- options ?: Operation32 ;
123- head ?: Operation32 ;
124- patch ?: Operation32 ;
125- trace ?: Operation32 ;
126- servers ?: Array < { url : string ; description ?: string } > ;
127- parameters ?: Parameter32 [ ] ;
116+ get ?: Operation ;
117+ put ?: Operation ;
118+ post ?: Operation ;
119+ delete ?: Operation ;
120+ options ?: Operation ;
121+ head ?: Operation ;
122+ patch ?: Operation ;
123+ trace ?: Operation ;
124+ servers ?: Server [ ] ;
125+ parameters ?: Parameter [ ] ;
128126} ;
129127
130- export type Operation32 = {
128+ export type Operation = {
131129 tags ?: string [ ] ;
132130 summary ?: string ;
133131 description ?: string ;
134- externalDocs ?: ExternalDocs32 ;
132+ externalDocs ?: ExternalDocs ;
135133 operationId ?: string ;
136- parameters ?: Parameter32 [ ] ;
137- requestBody ?: RequestBody32 ;
138- responses : Record < string , Response32 > ;
139- callbacks ?: Record < string , Callback32 > ;
134+ parameters ?: Parameter [ ] ;
135+ requestBody ?: RequestBody ;
136+ responses : Record < string , Response > ;
137+ callbacks ?: Record < string , Callback > ;
140138 deprecated ?: boolean ;
141- security ?: SecurityRequirement32 [ ] ;
142- servers ?: Array < { url : string ; description ?: string } > ;
139+ security ?: SecurityRequirement [ ] ;
140+ servers ?: Server [ ] ;
143141} ;
144142
145- export type Components32 = {
143+ export type Components = {
146144 schemas ?: Record < string , OasSchema32 > ;
147- responses ?: Record < string , Response32 > ;
148- parameters ?: Record < string , Parameter32 > ;
149- examples ?: Record < string , Example32 > ;
150- requestBodies ?: Record < string , RequestBody32 > ;
151- headers ?: Record < string , Header32 > ;
152- securitySchemes ?: Record < string , SecurityScheme32 > ;
153- links ?: Record < string , Link32 > ;
154- callbacks ?: Record < string , Callback32 > ;
145+ responses ?: Record < string , Response > ;
146+ parameters ?: Record < string , Parameter > ;
147+ examples ?: Record < string , Example > ;
148+ requestBodies ?: Record < string , RequestBody > ;
149+ headers ?: Record < string , Header > ;
150+ securitySchemes ?: Record < string , SecurityScheme > ;
151+ links ?: Record < string , Link > ;
152+ callbacks ?: Record < string , Callback > ;
155153} ;
156154
157- export type ExternalDocs32 = {
155+ export type ExternalDocs = {
158156 description ?: string ;
159157 url : string ;
160158} ;
161159
162- export * from "../lib/index.js" ;
160+ export * from "../lib/index.js" ;
0 commit comments