[BUG] [DART] All generated enums are commented, they are not usable.
Created by: ka-zo
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? yes, see issue #4973 -
Have you validated the input using an OpenAPI validator (example)? yes -
What's the version of OpenAPI Generator used? v4.2.2 -
Have you search for related issues/PRs? yes -
What's the actual output vs expected output? I expect to see in the generated model dart files enums, that are automatically used to prevent assigning a not allowed value to a field of a generated class. Also, I would like to use such generated enums to manually modify the content of such fields to any of the allowed values.
openapi-generator version
v4.2.2
OpenAPI declaration file content or url
See issue #4973
Command line used for generation
See issue #4973
Steps to reproduce
Generate the Dart code, and open any model files, where you expect enums, such as openapi-test\lib\model\age_value.dart. There you see in the AgeValue class declaration:
//enum unitEnum { month, };{
Suggest a fix
Generated enums should not be commented, and should be automatically used for field value validation during assignment. They should also be usable to be able to assign only allowed values to a field during manual assignment.