@@ -2659,11 +2659,13 @@ public CodegenOperation fromOperation(String path,
2659
2659
CodegenParameter bodyParam = null ;
2660
2660
RequestBody requestBody = operation .getRequestBody ();
2661
2661
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" ))) {
2665
2666
// process form parameters
2666
2667
formParams = fromRequestBodyToFormParameters (requestBody , imports );
2668
+ op .isMultipart = contentType .toLowerCase (Locale .ROOT ).startsWith ("multipart" );
2667
2669
for (CodegenParameter cp : formParams ) {
2668
2670
postProcessParameter (cp );
2669
2671
}
@@ -4463,8 +4465,8 @@ public boolean hasFormParameter(OpenAPI openAPI, Operation operation) {
4463
4465
4464
4466
for (String consume : consumesInfo ) {
4465
4467
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" ) )) {
4468
4470
return true ;
4469
4471
}
4470
4472
}
0 commit comments