Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #4974
Closed
Open
Issue created Jan 11, 2020 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[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.

Assignee
Assign to
Time tracking