-
-
Notifications
You must be signed in to change notification settings - Fork 769
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: don't interpret simple parameter as deepObject #1570
fix: don't interpret simple parameter as deepObject #1570
Conversation
@RobbeSneyders Here is my take on a fix. It works fine in our application: $ http :8080/api "filter[surname]_bogus"=="greinacher"
HTTP/1.1 400 Bad Request
Content-Length: 235
Content-Type: application/vnd.api+json; charset=utf-8
Date: Tue, 02 Aug 2022 14:56:31 GMT
{
"errors": [
{
"code": "xrn:err:core:invalidRequestParameter",
"detail": "Extra query parameter(s) filter[surname]_bogus not in spec",
"id": "a6a0b17e-e52f-37e4-a7d9-6c2e926ed4f8",
"status": "400",
"title": "Invalid Request Parameter"
}
]
} |
if not self._is_deep_object_style_param(root_key): | ||
return k, v, False | ||
|
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.
This is the first place where we know the root parameter name and have the schema information available. We already have a lot of special casing here, so that follow-up code can assume everything is fine. Let me know if you prefer to move that checker somewhere else.
cf35777
to
10b021d
Compare
10b021d
to
6327904
Compare
Thanks @fgreinacher! |
Thanks @RobbeSneyders, I was wondering how this failure could be related to my change :) The MR looks good to me! |
@RobbeSneyders I'm planning the last days before my summer vacation. Do you think we could get this in early next week so I can verify it with our services? 🙇 |
Sorry for the delay, I was on vacation myself :) |
* fix: don't interpret simple parameter as deepObject * Fix flake8 issues Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
* fix: don't interpret simple parameter as deepObject * Fix flake8 issues Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
Fixes #1565