-
Notifications
You must be signed in to change notification settings - Fork 6k
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
If my response has a key with a hyphen character, swagger generates properties with invalid identifiers #503
Comments
The pattern for fixing this is has been committed for java. It needs to be applied to other languages, and in broader context. |
cchafer
added a commit
to cchafer/swagger-codegen
that referenced
this issue
Mar 17, 2015
* commit 'c96853d5aaaae3da6b40f7a204ed76faf1e7a05a': fix and tests for swagger-api#503 removed unnecessary file removed description fixed context path added context path added more helpful error trace Adding defintion of security schemes in CodegenSecurity add ruby codegen, update sample (petstore) for ruby update php to support user agent
cchafer
added a commit
to cchafer/swagger-codegen
that referenced
this issue
Mar 17, 2015
* develop_2.0: fix and tests for swagger-api#503 removed unnecessary file removed description fixed context path added context path added more helpful error trace Adding defintion of security schemes in CodegenSecurity Adding defintion of security schemes in CodegenSecurity add ruby codegen, update sample (petstore) for ruby update php to support user agent Conflicts: modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenSecurity.java
I guess replacing the hyphen with an underscore is good too. ;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My schema:
Then in the generated binding code I see definitions like
That is, there is a hyphen. Hyphen is not a valid character in identifiers in most programming languages. As far as I know, hyphen works only in lisps.
I tested this with Python, Java and Scala codegen. Happens in all those languages. I suggest that the specification should be amended with a new property that would allow me to specify a new name for the parameter using only A-Za.z_ characters.
The text was updated successfully, but these errors were encountered: