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, all] Integer enum parameters are not put into swagger model #3964

Closed
pelepelin opened this issue Oct 11, 2016 · 3 comments
Closed

Comments

@pelepelin
Copy link

Description

Proper descriptions for integer enum parameters are not present with neither -l swagger nor -DdebugOperations.

Swagger-codegen version

2.2.1 and current master

Swagger declaration file content or url

Source JSON: https://gist.github.com/checat/1d9b014e39e9767cf30ba401d2cf18c4#file-source-json

Result JSON: https://gist.github.com/checat/1d9b014e39e9767cf30ba401d2cf18c4#file-swagger-json

Command line used for generation

java -DdebugOperations -jar swagger-codegen-cli-2.2.1.jar generate -i source.json -l swagger -o out-swagger

Steps to reproduce

Just generate. See result contains "enum" : [ null, null ] for "integerEnum" and does not contain "enum" for "integerArrayEnum", while string parameter has proper output

Related issues

#2508

@pelepelin
Copy link
Author

I assume other non-string types are affected the same way.

@fehguy
Copy link
Contributor

fehguy commented Feb 3, 2017

Fixed by latest parser.

@fehguy fehguy closed this as completed Feb 3, 2017
@jtegile
Copy link

jtegile commented Feb 17, 2017

While the latest parser works, the generated java client code is not compilable (and Ruby as well).

For java, the compilation error looks like

incompatible types: int cannot be converted to java.lang.String due to use of @SerializedName(1)

For Ruby, the error looks like

syntax error, unexpected '=', expecting keyword_end (SyntaxError) 0 = 0.freeze

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

3 participants