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

Swagger to typescript enum property name issue #2009

Closed
johnnyzh82 opened this issue Mar 9, 2019 · 0 comments
Closed

Swagger to typescript enum property name issue #2009

johnnyzh82 opened this issue Mar 9, 2019 · 0 comments

Comments

@johnnyzh82
Copy link

I use nswag to generate typescript model from swagger json. I found an issue when enum string contains invalid characters which are unable to map to enum keys.

"enum": [
     "Test1",
     "Test2",
     "Test1,Test2",
],

And result of typescript model doesn't transpile to js due to an invalid key in enum property (has comma in this case).

export enum MyEnum{
    Test1= "Test1",
    Test2= "Test2",
    Test1,Test2= "Test1,Test2",
}

The typescript version I use is 3.2 and nswag version is 12.0.15.

Thanks

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

1 participant