@@ -561,21 +561,48 @@ export class SchemaRoutes {
561
561
} ) ;
562
562
}
563
563
564
- if ( routeParams . formData . length ) {
565
- contentKind = CONTENT_KIND . FORM_DATA ;
564
+ if (
565
+ contentKind === CONTENT_KIND . URL_ENCODED &&
566
+ routeParams . formData . length
567
+ ) {
566
568
schema = this . convertRouteParamsIntoObject ( routeParams . formData ) ;
567
569
content = this . schemaParserFabric . getInlineParseContent (
568
570
schema ,
569
571
typeName ,
570
572
[ operationId ] ,
571
573
) ;
572
- } else if ( contentKind === CONTENT_KIND . FORM_DATA ) {
573
- schema = this . getSchemaFromRequestType ( requestBody ) ;
574
+ } else if ( routeParams . formData . length ) {
575
+ contentKind = CONTENT_KIND . FORM_DATA ;
576
+ schema = this . convertRouteParamsIntoObject ( routeParams . formData ) ;
574
577
content = this . schemaParserFabric . getInlineParseContent (
575
578
schema ,
576
579
typeName ,
577
580
[ operationId ] ,
578
581
) ;
582
+ } else if ( contentKind === CONTENT_KIND . URL_ENCODED ) {
583
+ schema = this . getSchemaFromRequestType ( requestBody ) ;
584
+ content = this . schemaParserFabric . schemaUtils . safeAddNullToType (
585
+ requestBody ,
586
+ this . getTypeFromRequestInfo ( {
587
+ requestInfo : requestBody ,
588
+ parsedSchemas,
589
+ operationId,
590
+ defaultType : "any" ,
591
+ typeName,
592
+ } ) ,
593
+ ) ;
594
+ } else if ( contentKind === CONTENT_KIND . FORM_DATA ) {
595
+ schema = this . getSchemaFromRequestType ( requestBody ) ;
596
+ content = this . schemaParserFabric . schemaUtils . safeAddNullToType (
597
+ requestBody ,
598
+ this . getTypeFromRequestInfo ( {
599
+ requestInfo : requestBody ,
600
+ parsedSchemas,
601
+ operationId,
602
+ defaultType : "any" ,
603
+ typeName,
604
+ } ) ,
605
+ ) ;
579
606
} else if ( requestBody ) {
580
607
schema = this . getSchemaFromRequestType ( requestBody ) ;
581
608
content = this . schemaParserFabric . schemaUtils . safeAddNullToType (
@@ -1074,6 +1101,12 @@ export class SchemaRoutes {
1074
1101
security : hasSecurity ,
1075
1102
method : method ,
1076
1103
requestParams : requestParamsSchema ,
1104
+ type :
1105
+ requestBodyInfo . contentKind === CONTENT_KIND . FORM_DATA
1106
+ ? "multipart/form-data"
1107
+ : requestBodyInfo . contentKind === CONTENT_KIND . URL_ENCODED
1108
+ ? "application/x-www-form-urlencoded"
1109
+ : undefined ,
1077
1110
1078
1111
payload : specificArgs . body ,
1079
1112
query : specificArgs . query ,
0 commit comments