Skip to content

[typescript] Introduce "enumPropertyNaming" option#5162

Merged
macjohnny merged 6 commits intoOpenAPITools:masterfrom
crunchbase:typescript-enumVarName
Jan 31, 2020
Merged

[typescript] Introduce "enumPropertyNaming" option#5162
macjohnny merged 6 commits intoOpenAPITools:masterfrom
crunchbase:typescript-enumVarName

Conversation

@amakhrov
Copy link
Copy Markdown
Contributor

This works similar to the existing "modelPropertyNaming", but applies to enum var names instead of model properties.
Default value is "PascalCase", which reflects the way it works currently.

Personally, I only need this configurable in the typescript-angular generator now. However, since the enum var name transformation is implemented in the abstract typescript class, I thought it would be beneficial to keep consistency across multiple typescript generators. After all, this is quite a generic setting, not specific to a particular framework.

PR checklist

  • Read the contribution guidelines.
  • 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.

@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @nicokoenig @topce @akehir @petejohansonxo

@auto-labeler
Copy link
Copy Markdown

auto-labeler Bot commented Jan 30, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

Comment thread docs/generators/javascript-flowtyped.md Outdated
@macjohnny
Copy link
Copy Markdown
Member

note: instead of fake commits, you can also close and re-open the PR to trigger CI

@macjohnny macjohnny added this to the 4.2.3 milestone Jan 30, 2020
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the available values in ENUM_PROPERTY_NAMING_TYPE could be listed automatically, so the comment will not be outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, will do!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you would want to add a test for the non-original case, too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@macjohnny
Copy link
Copy Markdown
Member

there seems to be some issue with the option parsing, see https://app.shippable.com/github/OpenAPITools/openapi-generator/runs/14327/1/console

@amakhrov amakhrov force-pushed the typescript-enumVarName branch from 26a9a1b to 92329c8 Compare January 30, 2020 17:43
@amakhrov
Copy link
Copy Markdown
Contributor Author

there seems to be some issue with the option parsing

Looks like Kotlin build is broken - no idea why. Rebasing my branch from the latest master to see if it's gonna self-resolve

@amakhrov
Copy link
Copy Markdown
Contributor Author

The last CI step still fails with a kotlin-related error.
I can see that some other open PRs also fail with the same error. Is it a global issue with configuration / 3rd party service?

@macjohnny macjohnny merged commit f0d92bb into OpenAPITools:master Jan 31, 2020
@amakhrov amakhrov deleted the typescript-enumVarName branch January 31, 2020 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants