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
[Python] boolean query parameter capitalization #1260
Comments
|
@ryanfox one workaround is to document the query parameter as a string instead of boolean and users will need to input either "true" or "false" Another way is to use customized templates with the |
|
Thanks for the info. That's not going to work for the use case I am working with - what do you think the chances are of implementing a fix? In any case, good to know there is a workaround. |
|
@ryanfox why would the string solution not work in your use case? |
|
@spacether Perhaps because it adds a lot of noise to the spec, lies to every tool involved including the API generator, and generally just smells of a massive, dirty hack? :)) |


(Copy of swagger-api/swagger-codegen#8433)
Description
The generated python client translates boolean query parameters in Python case - i.e. "True"/"False" rather than "true"/"false".
I am dealing with a case-sensitive API endpoint, which expects a boolean query parameter, and treats anything except "0" and "false" as true - including "False" evaluating to true.
Per RFC 3986, the query part of a URI should be treated as case-sensitive. I suspect many (most?) servers in the wild expect "false", in line with the variable names in most languages.
Is this expected behavior?
Swagger-codegen version
2.4.0-SNAPSHOT
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Suggest a fix/enhancement
Suggestion: instead of "True" or "False", convert to the string "true" or "false".
The text was updated successfully, but these errors were encountered: