mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 14:40:53 +00:00
[Java] Interpret consumes '*/*' as 'application/json' (#6175)
This commit is contained in:
parent
b2ef88eac6
commit
44e7b5dd3f
@ -519,10 +519,10 @@ public class ApiClient {
|
|||||||
*
|
*
|
||||||
* @param contentTypes The Content-Type array to select from
|
* @param contentTypes The Content-Type array to select from
|
||||||
* @return The Content-Type header to use. If the given array is empty,
|
* @return The Content-Type header to use. If the given array is empty,
|
||||||
* JSON will be used.
|
* or matches "any", JSON will be used.
|
||||||
*/
|
*/
|
||||||
public String selectHeaderContentType(String[] contentTypes) {
|
public String selectHeaderContentType(String[] contentTypes) {
|
||||||
if (contentTypes.length == 0) {
|
if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) {
|
||||||
return "application/json";
|
return "application/json";
|
||||||
}
|
}
|
||||||
for (String contentType : contentTypes) {
|
for (String contentType : contentTypes) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user