We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Activating the VALIDATE_FILTERS setting causes request with filters on sub-documents' fields to fail.
VALIDATE_FILTERS
Steps to reproduce Suppose you have a domain resource with the following schema:
'collection': { 'schema': { 'sub_documents': { 'type': 'list', 'schema': { 'type': 'dict', 'schema' : { 'foo': {'type': 'string'} 'bar': {'type': 'integer'} } } } } }
Performing a request like: http://<api_server>/collection?where={"sub_documents.bar": 5} returns the following response:
http://<api_server>/collection?where={"sub_documents.bar": 5}
{ "_status": "ERR", "_error": { "code": 400, "message": "filter on '%s' is invalid" } }
This seems to be caused in eve/utils.py at lines 403-406:
eve/utils.py
if config.VALIDATE_FILTERS: res_schema = config.DOMAIN[resource]['schema'] if key not in res_schema: return "filter on '%s' is invalid"
In this scenario, key will be sub_documents.bar which is not a valid key in the res_schema dict (whereas sub_documents is).
key
sub_documents.bar
res_schema
sub_documents
The text was updated successfully, but these errors were encountered:
Excellent. Looks like we're missing support for sub-document parsing here. Feel free to submit a PR if so inclined, I will gladly review it.
Sorry, something went wrong.
Fix VALIDATE_FILTERS behaviour for filters on sub-document fields (is…
6168ae9
…sue pyeve#1123)
ded8489
No branches or pull requests
Activating the
VALIDATE_FILTERS
setting causes request with filters on sub-documents' fields to fail.Steps to reproduce
Suppose you have a domain resource with the following schema:
Performing a request like:
http://<api_server>/collection?where={"sub_documents.bar": 5}
returns the following response:
This seems to be caused in
eve/utils.py
at lines 403-406:In this scenario,
key
will besub_documents.bar
which is not a valid key in theres_schema
dict (whereassub_documents
is).The text was updated successfully, but these errors were encountered: