forked from loafle/openapi-generator-original
[Java][Native] Fix an issue leading to an altered String parameter when consuming formatted strings like XML (#11640)
* Fix the generated request builder when using a string body parameter * Update the samples according to the fix for #11638
This commit is contained in:
committed by
GitHub
parent
d6a97b0c39
commit
d45cb6511f
@@ -519,12 +519,7 @@ public class FakeApi {
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "*/*");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
|
||||
@@ -445,12 +445,7 @@ public class FakeApi {
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "*/*");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user