-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Open
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
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
openapi-generator/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache
Line 292 in 8c337f0
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
Suggest a fix
Revert the usage of String(byte[] bytes)
or use public String(byte[] bytes, Charset charset)