@@ -2659,11 +2659,13 @@ public CodegenOperation fromOperation(String path,
26592659 CodegenParameter bodyParam = null ;
26602660 RequestBody requestBody = operation .getRequestBody ();
26612661 if (requestBody != null ) {
2662- if (getContentType (requestBody ) != null &&
2663- (getContentType (requestBody ).toLowerCase (Locale .ROOT ).startsWith ("application/x-www-form-urlencoded" ) ||
2664- getContentType (requestBody ).toLowerCase (Locale .ROOT ).startsWith ("multipart" ))) {
2662+ String contentType = getContentType (requestBody );
2663+ if (contentType != null &&
2664+ (contentType .toLowerCase (Locale .ROOT ).startsWith ("application/x-www-form-urlencoded" ) ||
2665+ contentType .toLowerCase (Locale .ROOT ).startsWith ("multipart" ))) {
26652666 // process form parameters
26662667 formParams = fromRequestBodyToFormParameters (requestBody , imports );
2668+ op .isMultipart = contentType .toLowerCase (Locale .ROOT ).startsWith ("multipart" );
26672669 for (CodegenParameter cp : formParams ) {
26682670 postProcessParameter (cp );
26692671 }
@@ -4463,8 +4465,8 @@ public boolean hasFormParameter(OpenAPI openAPI, Operation operation) {
44634465
44644466 for (String consume : consumesInfo ) {
44654467 if (consume != null &&
4466- consume .toLowerCase (Locale .ROOT ).startsWith ("application/x-www-form-urlencoded" ) ||
4467- consume .toLowerCase (Locale .ROOT ).startsWith ("multipart" )) {
4468+ ( consume .toLowerCase (Locale .ROOT ).startsWith ("application/x-www-form-urlencoded" ) ||
4469+ consume .toLowerCase (Locale .ROOT ).startsWith ("multipart" ) )) {
44684470 return true ;
44694471 }
44704472 }
0 commit comments