Skip to content
New issue

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 key substitution of disallowed characters #74

Closed
stephenwil opened this issue Dec 17, 2018 · 1 comment
Closed

Enum key substitution of disallowed characters #74

stephenwil opened this issue Dec 17, 2018 · 1 comment

Comments

@stephenwil
Copy link

Swagger has:

  "enum": [
        "Business",
        "Personal",
        "School",
        "Alternate 1",
        "Alternate 2",
        "Alternate 3",
        "Alternate 4"
      ]

But generated typescript enum key values aren't valid:

export enum EmailType {
  Business = "Business",
  Personal = "Personal",
  School = "School",
  Alternate 1 = "Alternate 1",
  Alternate 2 = "Alternate 2",
  Alternate 3 = "Alternate 3",
  Alternate 4 = "Alternate 4",
@vmasek
Copy link
Member

vmasek commented Dec 17, 2018

Thanks for a bug report, we need to substitute whitespaces with an underscore.

I'll try to fix it with other things this week. If it is blocking, just edit the generated enum and add an underscore, it will be like that in the next release.

@vmasek vmasek changed the title Enums get generated in reverse Enum key substitution of disallowed characters Jan 4, 2019
vmasek added a commit that referenced this issue Jan 10, 2019
@vmasek vmasek closed this as completed in 7214f2b Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants