@@ -183,20 +183,58 @@ type Operation = {
183183 servers ?: Server [ ] ;
184184} ;
185185
186- type Parameter = {
186+ export type Parameter = {
187187 name : string ;
188- in : "query" | "querystring" | "header" | "path" | "cookie" ;
189188 description ?: string ;
190189 required ?: boolean ;
191190 deprecated ?: boolean ;
192191 allowEmptyValue ?: boolean ;
193- } & Examples & ( {
194- style ?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" ;
192+ } & Examples & (
193+ (
194+ {
195+ in : "path" ;
196+ required : true ;
197+ } & (
198+ ( { style ?: "matrix" | "label" | "simple" } & SchemaParameter )
199+ | ContentParameter
200+ )
201+ ) | (
202+ {
203+ in : "query" ;
204+ } & (
205+ ( { style ?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject" } & SchemaParameter )
206+ | ContentParameter
207+ )
208+ ) | (
209+ {
210+ in : "header" ;
211+ } & (
212+ ( { style ?: "simple" } & SchemaParameter )
213+ | ContentParameter
214+ )
215+ ) | (
216+ {
217+ in : "cookie" ;
218+ } & (
219+ ( { style ?: "cookie" } & SchemaParameter )
220+ | ContentParameter
221+ )
222+ ) | (
223+ { in : "querystring" } & ContentParameter
224+ )
225+ ) ;
226+
227+ type ContentParameter = {
228+ schema ?: never ;
229+ content : Record < string , MediaType | Reference > ;
230+ } ;
231+
232+ type SchemaParameter = {
195233 explode ?: boolean ;
234+ allowReserved ?: boolean ;
196235 schema : OasSchema32 ;
197- } | {
198- content : Record < string , MediaType | Reference > ;
199- } ) ;
236+ content ?: never ;
237+ } ;
200238
201239type RequestBody = {
202240 description ?: string ;
@@ -207,21 +245,31 @@ type RequestBody = {
207245type MediaType = {
208246 schema ?: OasSchema32 ;
209247 itemSchema ?: OasSchema32 ;
248+ } & Examples & ( {
210249 encoding ?: Record < string , Encoding > ;
250+ prefixEncoding ?: never ;
251+ itemEncoding ?: never ;
252+ } | {
253+ encoding ?: never ;
211254 prefixEncoding ?: Encoding [ ] ;
212255 itemEncoding ?: Encoding ;
213- } & Examples ;
256+ } ) ;
214257
215258type Encoding = {
216259 contentType ?: string ;
217260 headers ?: Record < string , Header | Reference > ;
218- encoding ?: Record < string , Encoding > ;
219- prefixEncoding ?: Encoding [ ] ;
220- itemEncoding ?: Encoding ;
221261 style ?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject" ;
222262 explode ?: boolean ;
223263 allowReserved ?: boolean ;
224- } ;
264+ } & ( {
265+ encoding ?: Record < string , Encoding > ;
266+ prefixEncoding ?: never ;
267+ itemEncoding ?: never ;
268+ } | {
269+ encoding ?: never ;
270+ prefixEncoding ?: Encoding [ ] ;
271+ itemEncoding ?: Encoding ;
272+ } ) ;
225273
226274type Responses = {
227275 default ?: Response | Reference ;
@@ -245,11 +293,17 @@ type Examples = {
245293type Example = {
246294 summary ?: string ;
247295 description ?: string ;
296+ } & ( {
297+ value ?: Json ;
298+ dataValue ?: never ;
299+ serializedValue ?: never ;
300+ externalValue ?: never ;
301+ } | {
302+ value ?: never ;
248303 dataValue ?: Json ;
249304 serializedValue ?: string ;
250305 externalValue ?: string ;
251- value ?: Json ;
252- } ;
306+ } ) ;
253307
254308type Link = {
255309 operationRef ?: string ;
@@ -288,16 +342,32 @@ type Reference = {
288342} ;
289343
290344type SecurityScheme = {
291- type : "apiKey" | "http" | "mutualTLS" | "oauth2" | "openIdConnect" ;
345+ type : "apiKey" ;
292346 description ?: string ;
293- name ?: string ;
294- in ?: "query" | "header" | "cookie" ;
295- scheme ?: string ;
347+ name : string ;
348+ in : "query" | "header" | "cookie" ;
349+ deprecated ?: boolean ;
350+ } | {
351+ type : "http" ;
352+ description ?: string ;
353+ scheme : string ;
296354 bearerFormat ?: string ;
297- flows ?: OauthFlows ;
298- openIdConnectUrl ?: string ;
355+ deprecated ?: boolean ;
356+ } | {
357+ type : "mutualTLS" ;
358+ description ?: string ;
359+ deprecated ?: boolean ;
360+ } | {
361+ type : "oauth2" ;
362+ description ?: string ;
363+ flows : OauthFlows ;
299364 oauth2MetadataUrl ?: string ;
300365 deprecated ?: boolean ;
366+ } | {
367+ type : "openIdConnect" ;
368+ description ?: string ;
369+ openIdConnectUrl : string ;
370+ deprecated ?: boolean ;
301371} ;
302372
303373type OauthFlows = {
0 commit comments