-
-
Notifications
You must be signed in to change notification settings - Fork 762
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 Boolean types in code generated by swagger-codegen #127
Comments
@scolby33 thanks for the bug report, we'll look into it (apparently @rafaelcaricio will tackle it).. |
I was investigating on this issue and I found out that the default property should be I found out that the Swagger model converts the If you change the generated I guess that is an issue in all generators that output swagger definitions like that. |
Giving a second thought on it. Maybe an option is to make Connexion accept literal boolean values and not only string boolean values as default value. |
Yes, we should update Connexion (ref. swagger-api/swagger-core#1368) |
I can confirm that placing quotes around the default values fixes the issue. Is the issue that YAML expects that Boolean values are quoted? Here in the spec, it seems that Booleans can be I'm also confused as to why |
Yes, I searched further and we should accept in Connexion the |
Oh, I see we commented at the same time. Thanks for the update! |
@scolby33 the fix was released in https://github.com/zalando/connexion/releases/tag/1.0.49 Can you verify that it works for you? Thanks! |
Everything looks good! Thank you for your quick response and fix for this issue. |
Here is a minimal (non-)working example needed to reproduce this issue.
test.yml:
Process this file via swagger-codegen:
java -jar /usr/local/Cellar/swagger-codegen/2.1.5/libexec/swagger-codegen-cli.jar generate -i ./test.yml -l python-flask -o .
Here is the resulting swagger.yml:
Running this with
python app.py
results in the following error:Manually changing
boolean
in swagger.yml tobool
orBoolean
causes the script to run without error, but then the datatype in the Swagger UI is incorrect:Finally, changing
boolean
tobool
orBoolean
in the original test.yml causes the following error with swagger-codegen:I was also going to open an issue with swagger-codegen, but given the fact that altering the name of the type messes up its representation in the Swagger UI indicates to me that the problem is likely on connexion's end.
The text was updated successfully, but these errors were encountered: