mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 13:52:49 +00:00
Issue5613 (#5616)
* Fixed Issue5162 consumes in GET-Methods * Fixed Issue5613 * Ran the shell scripts under bin * Tab removed
This commit is contained in:
@@ -869,11 +869,13 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
hasFormParameters = true;
|
||||
}
|
||||
}
|
||||
String defaultContentType = hasFormParameters ? "application/x-www-form-urlencoded" : "application/json";
|
||||
String contentType = operation.getConsumes() == null || operation.getConsumes().isEmpty()
|
||||
? defaultContentType : operation.getConsumes().get(0);
|
||||
//only add content-Type if its no a GET-Method
|
||||
if(path.getGet() != null || ! operation.equals(path.getGet())){
|
||||
String defaultContentType = hasFormParameters ? "application/x-www-form-urlencoded" : "application/json";
|
||||
String contentType = operation.getConsumes() == null || operation.getConsumes().isEmpty() ? defaultContentType : operation.getConsumes().get(0);
|
||||
operation.setVendorExtension("x-contentType", contentType);
|
||||
}
|
||||
String accepts = getAccept(operation);
|
||||
operation.setVendorExtension("x-contentType", contentType);
|
||||
operation.setVendorExtension("x-accepts", accepts);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
Reference in New Issue
Block a user