Bug Report Checklist
Description
The change in api.mustache to use a new String instead of passing the InputStream direct to the ObjectMapper causes an encoding problem. ObjectMapper always uses UTF-8 for encoding. The Constructor String(byte[] bytes) uses the default Characterset of the running virtual machine.
openapi-generator version
7.11.0
OpenAPI declaration file content or url
|
String responseBody = new String(localVarResponse.body().readAllBytes()); |
Steps to reproduce
use a native client in a java app that is running with a default encoding, that is not UTF-8
Related issues/PRs
#20334
Suggest a fix
Revert the usage of String(byte[] bytes) or use public String(byte[] bytes, Charset charset)
Bug Report Checklist
Description
The change in
api.mustacheto use anew Stringinstead of passing the InputStream direct to the ObjectMapper causes an encoding problem. ObjectMapper always uses UTF-8 for encoding. The ConstructorString(byte[] bytes)uses the default Characterset of the running virtual machine.openapi-generator version
7.11.0
OpenAPI declaration file content or url
openapi-generator/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache
Line 292 in 8c337f0
Steps to reproduce
use a native client in a java app that is running with a default encoding, that is not UTF-8
Related issues/PRs
#20334
Suggest a fix
Revert the usage of
String(byte[] bytes)or usepublic String(byte[] bytes, Charset charset)