Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[dart-dio] Adds support for generating inline enums #5668

Merged
merged 2 commits into from
May 14, 2020

Conversation

josh-burton
Copy link
Contributor

Adds support for enums declared inline. Previously these would just generate as a string field. Now the enum is generated within the model class.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

CC: @ircecho @swipesight @jaumard @nickmeinhold @athornz @amondnet

@josh-burton josh-burton force-pushed the dart-dio-inline-enums branch from 27d1bf8 to 55cf738 Compare March 24, 2020 00:48
@jaumard
Copy link
Contributor

jaumard commented Apr 26, 2020

Why handle only inline enum and not reusable enums ?

@josh-burton josh-burton force-pushed the dart-dio-inline-enums branch from 55cf738 to a5d0ed3 Compare May 10, 2020 21:25
@josh-burton
Copy link
Contributor Author

Why handle only inline enum and not reusable enums ?

Reusable enums (enums declared as a definition are already handled. The model.mustache template redirects to either class.mustache or enum.mustache depending on whether the definition is an enum or not.

Previously these were generated as strings if declared inline in the spec.
@wing328
Copy link
Member

wing328 commented May 13, 2020

If no further feedback on this PR, I'll merge it tomorrow (Thur)

@wing328 wing328 merged commit 2dd5477 into OpenAPITools:master May 14, 2020
@kuhnroyal
Copy link
Contributor

@josh-burton There are missing imports for built_value collection due to the used BuiltSet in the inline enum in some cases.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants