-
-
Notifications
You must be signed in to change notification settings - Fork 753
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
fix-square bracket : V1 #1408
fix-square bracket : V1 #1408
Conversation
Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten
Its resolving this issues : #1271 |
Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten
Hi @LeComptoirDesPharmacies, thanks for the PR. |
Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten
Sorry for the delay, the test is ok now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test @LeComptoirDesPharmacies. Two more small comments, but we should be able to merge once you address those.
Hi, This PR is waiting for another review. Can someone do it please ? Best regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Gery! I left some comments, could you clarify?
Swagger2URIParser) | ||
from werkzeug.datastructures import MultiDict | ||
|
||
QUERY1 = MultiDict([("letters", "a"), ("letters", "b,c"), | ||
("letters", "d,e,f")]) | ||
QUERY2 = MultiDict([("letters", "a"), ("letters", "b|c"), | ||
("letters", "d|e|f")]) | ||
QUERY3 = MultiDict([("letters[eq]", ["a"]), ("letters[eq]", ["b", "c"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the query string that leads to this MultiDict
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its an API Rest design named LHS Brackets :
tests/decorators/test_uri_parsing.py
Outdated
|
||
|
||
@pytest.mark.parametrize("parser_class, expected, query_in, collection_format", [ | ||
(OpenAPIURIParser, ['d', 'e', 'f'], QUERY3, DICT), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, there is no dict collection format, is there?
Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten
@RobbeSneyders, sorry for the delay, thanks for your review. I took into account your comments. Best regards, |
Thanks @LeComptoirDesPharmacies! |
* fix-square bracket : V1 Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten * Fix syntax Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten * Add OpenAPI test with square brackets Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten * Fix test Fix alphabetic order in import Fix test parametrization Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten * square bracket : Set collection format to None for OpenAPIURIParser Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten Co-authored-by: Géry THRASIBULE <g.thrasibule@lecomptoirdespharmacies.fr>
Fixes # .
Fix square bracket in query params. Example :
orderBy[eq]
.Its a quick fix to permit square bracket in query params, if they are define in the schema.
For query params who are not in the schema. Do default computation for deep object.
Changes proposed in this pull request:
sanitized
function to replace[
by_
. Example :orderBy[eq] -> order_by_eq
_make_deep_object
function to use key with square bracket in the name as a dict key if its define in the schema