[C# Client] Boolean query parameters are now lowercase #1711
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
ConvertToString
method of generated C# clients serializes boolean values toTrue
andFalse
, which means that boolean values in query parameters are eitherTrue
orFalse
.The OpenAPI 3.0 specification does not specify how boolean values are to be serialized when they are query parameters. However, when using a nodejs server generated by https://editor.swagger.io/, requests with
queryParam=True
andqueryParam=False
fail the built in validation in the server. The validation code is taken fromswagger-tools
, and can be seen here: https://github.com/apigee-127/swagger-tools/blob/master/lib/validators.js#L484 . I have tested that lower-casing the boolean values makes the requests pass this validation.From this, and from doing some googling, it would seem that people around the internet are of the opinion that boolean query parameters should either be serialized as "true" and "false", or alternatively "1" and "0".
I propose that one should use "true" and "false".
Edit: Sorry about the useless second commit. It would seem that the GitHub code editor automatically adds a newline at the end of the file. I can create a new PR if this is problematic.