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
Versions
openapi-dart-generator-5.12.jar
I believe it still happens in 8.1 since the code still contains the suspected cause
Suspected cause
The toEnumVarName function calls the escapeReservedWord function before calling the toVarName function. This causes the var name to not be found in the reserved words mappings.
Workaround
Use --reserved-words-mappings Late=,Late_=late
The text was updated successfully, but these errors were encountered:
Looking at the way this is handled, its actually handed to the Dart generator by the base infrastructure. The AbstractDartCodegen class (which comes from the main project) is what loads these in and the reserved words are predefined there. It looks like late is built in. Perhaps re-log your issue on the main OpenAPIGenerator - feel free to link this ticket as well as I would like to know what they say about it.
Describe the bug
When generating an enum that has a value that is a reserved word, the
--reserved-words-mappings
param is ignoredExpected behavior
The
--reserved-words-mappings
param should not be ignored for enum valuesTo Reproduce
Run:
java -cp 'openapi-generator-cli-5.2.1.jar;openapi-dart-generator-5.12.jar' org.openapitools.codegen.OpenAPIGenerator generate -g dart2-api --reserved-words-mappings late=late
Produces the following enum in Dart:
The expected enum in Dart is:
Versions
openapi-dart-generator-5.12.jar
I believe it still happens in 8.1 since the code still contains the suspected cause
Suspected cause
The
toEnumVarName
function calls theescapeReservedWord
function before calling thetoVarName
function. This causes the var name to not be found in the reserved words mappings.Workaround
Use
--reserved-words-mappings Late=,Late_=late
The text was updated successfully, but these errors were encountered: