Remove auto-JSONification of query params, allowing them to be unquoted#2309
Merged
Conversation
eddyashton
commented
Mar 11, 2021
|
non_json_query_parsing@20717 aka 20210316.28 vs main ewma over 20 builds from 20228 to 20700 |
jumaffre
approved these changes
Mar 15, 2021
letmaik
approved these changes
Mar 15, 2021
…to non_json_query_parsing
achamayou
reviewed
Mar 15, 2021
achamayou
reviewed
Mar 15, 2021
achamayou
reviewed
Mar 15, 2021
achamayou
approved these changes
Mar 15, 2021
Member
achamayou
left a comment
There was a problem hiding this comment.
I think it would be good to write some unit tests for the query parsing, to cover corner cases on separators etc.
Member
Author
I've added a unit test in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Resolves #2153.
The
json_handleradapter no longer parses the query string. Any request parameters which are included in the query string must be extracted manually by the handler, and we will not try to read/parse them beforehand. We do add some helper functions inhttp_query.hto remove some of the boiler plate in query parsing.The main benefit of this is that when those query parameters are strings they no longer need to be quoted. Additionally, this gives the app more precise control of the OpenAPI description (in a form we want to extend in future). It also makes parsing of
GETandPOSTrequests more consistent and removes the requirement that we are opinionated onGETs having no body (the pre-parsed JSON will now contain the body from either method, and query strings must be manually parsed in either method).