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

Issue with spinal casing when using NSwag #40

Closed
cwoolum opened this issue Mar 19, 2016 · 3 comments
Closed

Issue with spinal casing when using NSwag #40

cwoolum opened this issue Mar 19, 2016 · 3 comments

Comments

@cwoolum
Copy link

cwoolum commented Mar 19, 2016

My urls use spinal casing but when a method is generated in my typescript, ConvertToLowerStartIdentifier and ConvertToUpperStartIdentifier in GeneratorBase only take spaces into consideration. It should replaces dashes with underscores or camel case the value since dashes would break the typescript.

I'm not sure if this belongs here or as an override in ClientGeneratorBase in NSwag.

@RicoSuter
Copy link
Owner

The problem here is that we declare interfaces, and thus we cannot just rename the fields because then the interface would not match the actual data. The fix would be to use quotes as shown here: http://stackoverflow.com/questions/13661144/typescripts-hashtables-and-keys-with-a-dash

The only way to fix this is to also allow to generate classes instead of interfaces and copy the data into new instances of the classes when HTTP data is received. But this is a bigger update...

@RicoSuter
Copy link
Owner

1ccec95

@RicoSuter
Copy link
Owner

Added issue: #43

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

No branches or pull requests

2 participants