[Java][Native] Fix the Content-Type and Accept headers that were forced to application/json (#11303)

* [Java][Native] Fix the Content-Type and Accept headers that were forced to application/json

* Update the generated samples after fixing issue no. 6779
This commit is contained in:
Paul-Etienne François
2022-01-15 17:51:40 +01:00
committed by GitHub
parent 1b6d0f8746
commit 249968e397
9 changed files with 26 additions and 26 deletions

View File

@@ -341,9 +341,9 @@ public class {{classname}} {
}
{{/headerParams}}
{{#bodyParam}}
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{mediaType}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}");
{{/bodyParam}}
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{mediaType}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}");
{{#bodyParam}}
try {