-
Notifications
You must be signed in to change notification settings - Fork 293
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
Allow changing of format with query parameter #812
Labels
Comments
5 tasks
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue
The guides on https://django-rest-framework-json-api.readthedocs.io/en/stable/usage.html#configuration recommend including the
rest_framework_json_api.filters.QueryParameterValidationFilter
in initial configuration which is good advice, but by default, the Django REST Framework UI provides a dropdown which allows you to pickformat=api
orformat=vnd.api+json
Without allowing the
format
parameter through you get the following error:What needs to change
URL_FORMAT_OVERRIDE
tocontentFormat
in our README.QueryParameterValidationFilter
it's checked whether a query parameter is passed on which is equal configured value inURL_FORMAT_OVERRIDE
. If this is true and the value ofURL_FORMAT_OVERRIDE
is set to something else thanformat
then we let the user pass. IfURL_FORMAT_OVERRIDE
is still set toformat
a 400 error is raised (as would be the case today already without this change).reference DRF docs
This issue is created out of the pull request #535
The text was updated successfully, but these errors were encountered: