@@ -561,21 +561,48 @@ export class SchemaRoutes {
561561 } ) ;
562562 }
563563
564- if ( routeParams . formData . length ) {
565- contentKind = CONTENT_KIND . FORM_DATA ;
564+ if (
565+ contentKind === CONTENT_KIND . URL_ENCODED &&
566+ routeParams . formData . length
567+ ) {
566568 schema = this . convertRouteParamsIntoObject ( routeParams . formData ) ;
567569 content = this . schemaParserFabric . getInlineParseContent (
568570 schema ,
569571 typeName ,
570572 [ operationId ] ,
571573 ) ;
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 ) ;
574577 content = this . schemaParserFabric . getInlineParseContent (
575578 schema ,
576579 typeName ,
577580 [ operationId ] ,
578581 ) ;
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+ ) ;
579606 } else if ( requestBody ) {
580607 schema = this . getSchemaFromRequestType ( requestBody ) ;
581608 content = this . schemaParserFabric . schemaUtils . safeAddNullToType (
@@ -1074,6 +1101,12 @@ export class SchemaRoutes {
10741101 security : hasSecurity ,
10751102 method : method ,
10761103 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 ,
10771110
10781111 payload : specificArgs . body ,
10791112 query : specificArgs . query ,
0 commit comments