File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ const BASIC_MEDIA_TYPES = [
23
23
24
24
export function getContent ( openApi : OpenApi , content : Dictionary < OpenApiMediaType > ) : Content | null {
25
25
const basicMediaTypeWithSchema = Object . keys ( content )
26
- . filter ( mediaType => BASIC_MEDIA_TYPES . includes ( mediaType ) )
26
+ . filter ( mediaType => {
27
+ const cleanMediaType = mediaType . split ( ';' ) [ 0 ] . trim ( ) ;
28
+ return BASIC_MEDIA_TYPES . includes ( cleanMediaType ) ;
29
+ } )
27
30
. find ( mediaType => isDefined ( content [ mediaType ] ?. schema ) ) ;
28
31
if ( basicMediaTypeWithSchema ) {
29
32
return {
Original file line number Diff line number Diff line change 127
127
"nullable" : true ,
128
128
"content" : {
129
129
"application/json" : {
130
- "description" : " Message for default response" ,
131
130
"schema" : {
132
131
"$ref" : " #/components/schemas/ModelWithString"
133
132
}
239
238
"nullable" : true ,
240
239
"content" : {
241
240
"application/json" : {
242
- "description" : " Message for default response" ,
243
241
"schema" : {
244
242
"$ref" : " #/components/schemas/ModelWithString"
245
243
}
270
268
"required" : true ,
271
269
"content" : {
272
270
"application/json" : {
273
- "description" : " Message for default response" ,
274
271
"schema" : {
275
272
"$ref" : " #/components/schemas/ModelWithString"
276
273
}
299
296
"required" : false ,
300
297
"content" : {
301
298
"application/json" : {
302
- "description" : " Message for default response" ,
303
299
"schema" : {
304
300
"$ref" : " #/components/schemas/ModelWithString"
305
301
}
611
607
"default" : {
612
608
"content" : {
613
609
"application/json" : {
614
- "description" : " Message for default response" ,
615
610
"schema" : {
616
611
"$ref" : " #/components/schemas/ModelWithString"
617
612
}
1303
1298
"200" : {
1304
1299
"description" : " Success" ,
1305
1300
"content" : {
1306
- "application/json" : {
1301
+ "application/json; type=collection " : {
1307
1302
"schema" : {
1308
1303
"$ref" : " #/components/schemas/ModelWithString"
1309
1304
}
You can’t perform that action at this time.
0 commit comments