- 
                Notifications
    You must be signed in to change notification settings 
- Fork 300
Open
Labels
Description
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 pick format=api or format=vnd.api+json
Without allowing the format parameter through you get the following error:
HTTP 400 Bad Request
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/vnd.api+json
Vary: Accept
{
    "errors": [
        {
            "detail": "invalid query parameter: format",
            "source": {
                "pointer": "/data"
            },
            "status": "400"
        }
    ]
}
What needs to change
- We document to change URL_FORMAT_OVERRIDEtocontentFormatin our README.
- In the QueryParameterValidationFilterit'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_OVERRIDEis set to something else thanformatthen we let the user pass. IfURL_FORMAT_OVERRIDEis still set toformata 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
