@@ -79,7 +79,7 @@ type ExternalDocs = {
7979} ;
8080
8181type Xml = {
82- nodeType ?: string ;
82+ nodeType ?: "element" | "attribute" | "text" | "cdata" | "none" ;
8383 name ?: string ;
8484 namespace ?: string ;
8585 prefix ?: string ;
@@ -130,6 +130,7 @@ type ServerVariable = {
130130} ;
131131
132132type PathItem = {
133+ $ref ?: string ;
133134 summary ?: string ;
134135 description ?: string ;
135136 get ?: Operation ;
@@ -154,29 +155,30 @@ type Operation = {
154155 operationId ?: string ;
155156 parameters ?: ( Parameter | Reference ) [ ] ;
156157 requestBody ?: RequestBody | Reference ;
157- responses : Responses ;
158+ responses ? : Responses ;
158159 callbacks ?: Record < string , Callbacks | Reference > ;
159160 deprecated ?: boolean ;
160161 security ?: SecurityRequirement [ ] ;
161162 servers ?: Server [ ] ;
162163} ;
163164
165+ // TODO: Needs improvement
164166type Parameter = {
165167 name : string ;
166168 in : "query" | "querystring" | "header" | "path" | "cookie" ;
167169 description ?: string ;
168170 required ?: boolean ;
169171 deprecated ?: boolean ;
170172 allowEmptyValue ?: boolean ;
171- example ?: Json ;
172- examples ?: Record < string , Example | Reference > ;
173- style ?: string ;
173+ } & Examples & ( {
174+ style ?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" ;
174175 explode ?: boolean ;
175- allowReserved ?: boolean ;
176- schema ?: OasSchema32 ;
177- content ? : Record < string , MediaType | Reference > ;
178- } ;
176+ schema : OasSchema32 ;
177+ } | {
178+ content : Record < string , MediaType | Reference > ;
179+ } ) ;
179180
181+ // TODO: Needs improvement
180182type Example = {
181183 summary ?: string ;
182184 description ?: string ;
@@ -186,6 +188,11 @@ type Example = {
186188 value ?: Json ;
187189} ;
188190
191+ type Examples = {
192+ example ?: Json ;
193+ examples ?: Record < string , Example | Reference > ;
194+ } ;
195+
189196type Reference = {
190197 $ref : string ;
191198 summary ?: string ;
@@ -201,20 +208,19 @@ type RequestBody = {
201208type MediaType = {
202209 schema ?: OasSchema32 ;
203210 itemSchema ?: OasSchema32 ;
204- example ?: Json ;
205- examples ?: Record < string , Example | Reference > ;
206211 encoding ?: Record < string , Encoding > ;
207212 prefixEncoding ?: Encoding [ ] ;
208213 itemEncoding ?: Encoding ;
209- } ;
214+ } & Examples ;
210215
216+ // TODO: Needs improvement
211217type Encoding = {
212218 contentType ?: string ;
213219 headers ?: Record < string , Header | Reference > ;
214220 encoding ?: Record < string , Encoding > ;
215221 prefixEncoding ?: Encoding [ ] ;
216222 itemEncoding ?: Encoding ;
217- style ?: string ;
223+ style ?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject" ;
218224 explode ?: boolean ;
219225 allowReserved ?: boolean ;
220226} ;
@@ -223,26 +229,34 @@ type Header = {
223229 description ?: string ;
224230 required ?: boolean ;
225231 deprecated ?: boolean ;
226- example ?: Json ;
227- examples ?: Record < string , Example | Reference > ;
228- style ?: string ;
232+ } & Examples & ( {
233+ style ?: "simple" ;
229234 explode ?: boolean ;
230- schema ?: OasSchema32 ;
231- content ?: Record < string , MediaType | Reference > ;
232- } ;
235+ schema : OasSchema32 ;
236+ } | {
237+ content : Record < string , MediaType | Reference > ;
238+ } ) ;
233239
234240type Responses = {
235241 default ?: Response | Reference ;
236242} & Record < string , Response | Reference > ;
237243
244+ type Response = {
245+ summary ?: string ;
246+ description ?: string ;
247+ headers ?: Record < string , Header | Reference > ;
248+ content ?: Record < string , MediaType | Reference > ;
249+ links ?: Record < string , Link | Reference > ;
250+ } ;
251+
238252type Callbacks = Record < string , PathItem | Reference > ;
239253
240254type SecurityRequirement = Record < string , string [ ] > ;
241255
242256type Server = {
243257 url : string ;
244258 description ?: string ;
245- name : string ;
259+ name ? : string ;
246260 variables ?: Record < string , ServerVariable > ;
247261} ;
248262
@@ -260,6 +274,7 @@ type Components = {
260274 mediaTypes ?: Record < string , MediaType | Reference > ;
261275} ;
262276
277+ // TODO: Needs improvement
263278type SecurityScheme = {
264279 type : "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect" ;
265280 description ?: string ;
0 commit comments