Open mrajaian opened 3 years ago
In addition what was written in the initial question, the compilation-error that this causes is the following when:
[ERROR] /some/path/openapi/src/main/java/org/openapitools/client/model/ModelExample.java:[109,5] as of release 9, '_' is a keyword, and may not be used as an identifier
Description
When the model code to be generated is an enum and if one of the values is "==", then generation is not happening properly, it only gives a '_'
Swagger-codegen version
4.3.1
Swagger declaration file content or url
Command line used for generation
java -jar openapi-generator-cli.jar generate -i resources/openapi.yaml -g java -o mypkg/instana/openapi --skip-validate-spec -p dateLibrary=java8 --library native
Steps to reproduce
The generated client code is
Suggest a fix/enhancement
Special characters are replaced in https://github.com/swagger-api/swagger-codegen/blob/9de1f7baf0f681bb5b8b278c38550c9fe0bfb82b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java#L916
but the "==" is not covered here, perhaps, adding below in line number 948 would resolve this