We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum support for Dart is currently not working. There is a non-working partial implementation available that still uses the old dartson way.
git master at a5e26a4
"ACTION": { "enum": [ "NONE", "LOGOUT", "UPGRADE", "RESET_CLIENT_DB", "RELOAD_PAGE", "REGISTER" ] },
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i openapi.json -l dart -o api -DbrowserClient=false
@Entity() class ACTION { /// The underlying value of this enum member. final value; const ACTION._internal(this.value); static const ACTION nONE_ = const ACTION._internal("NONE"); ... static const ACTION rEGISTER_ = const ACTION._internal("REGISTER"); } class ACTIONTypeTransformer extends TypeTransformer<ACTION> { @override dynamic encode(ACTION data) { return data.value; } @override ACTION decode(dynamic data) { switch (data) { case "NONE": return ACTION.nONE_; ... case "REGISTER": return ACTION.rEGISTER_; default: throw('Unknown enum value to decode: $data'); } } }
first mentioned in: #7418
see #7418 (comment)
The text was updated successfully, but these errors were encountered:
Duplicate of #5454
Sorry, something went wrong.
No branches or pull requests
Description
Enum support for Dart is currently not working. There is a non-working partial implementation available that still uses the old dartson way.
Swagger-codegen version
git master at a5e26a4
Swagger declaration file content or url
Command line used for generation
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i openapi.json -l dart -o api -DbrowserClient=false
Steps to reproduce
Related issues/PRs
first mentioned in:
#7418
Suggest a fix/enhancement
see
#7418 (comment)
The text was updated successfully, but these errors were encountered: