You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.util.Scanner s = new java.util.Scanner(entity.getContent()).useDelimiter("\\A");
In my case this makes generated code unusable because API provider (who controls yaml with spec) uses diaciritics in some params. And those params are changed by OpenApi into enums. And when data, with those params, is actually returned from REST end point the encoding does not match and I get java.lang.IllegalArgumentException Exception - Unexpected value '...' in fromValue method.
openapi-generator version
7.0.1
Suggest a fix
I can provide a patch here, but first I would like to discuss which should be preffered way of solving this - forcing "UTF-8" encoding (which works for me) or providing new parameter that would allow to choose encoding.
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
Scanner used for response stream reading uses JVM default encoding (does not have second parameter "charsetName" provided - https://docs.oracle.com/javase/8/docs/api/java/util/Scanner.html#Scanner-java.nio.file.Path-java.lang.String-).
openapi-generator/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache
Line 840 in ba367e6
In my case this makes generated code unusable because API provider (who controls yaml with spec) uses diaciritics in some params. And those params are changed by OpenApi into enums. And when data, with those params, is actually returned from REST end point the encoding does not match and I get java.lang.IllegalArgumentException Exception - Unexpected value '...' in fromValue method.
openapi-generator version
7.0.1
Suggest a fix
I can provide a patch here, but first I would like to discuss which should be preffered way of solving this - forcing "UTF-8" encoding (which works for me) or providing new parameter that would allow to choose encoding.
The text was updated successfully, but these errors were encountered: