From 0da5fc22a88f4723b0d7434b432f9537c699355f Mon Sep 17 00:00:00 2001 From: Ben Bradshaw Date: Fri, 28 Dec 2018 15:03:38 +1300 Subject: [PATCH 1/2] Allow the GET param format through the filters --- rest_framework_json_api/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework_json_api/filters.py b/rest_framework_json_api/filters.py index f0b95a35..400f0870 100644 --- a/rest_framework_json_api/filters.py +++ b/rest_framework_json_api/filters.py @@ -70,7 +70,7 @@ class QueryParameterValidationFilter(BaseFilterBackend): """ #: compiled regex that matches the allowed http://jsonapi.org/format/#query-parameters: #: `sort` and `include` stand alone; `filter`, `fields`, and `page` have []'s - query_regex = re.compile(r'^(sort|include)$|^(filter|fields|page)(\[[\w\.\-]+\])?$') + query_regex = re.compile(r'^(sort|include|format)$|^(filter|fields|page)(\[[\w\.\-]+\])?$') def validate_query_params(self, request): """ From 7a0d0b66a3fe1642284070daf13664aa83a2c0a1 Mon Sep 17 00:00:00 2001 From: Ben Bradshaw Date: Fri, 28 Dec 2018 15:05:48 +1300 Subject: [PATCH 2/2] Update docs to match --- rest_framework_json_api/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework_json_api/filters.py b/rest_framework_json_api/filters.py index 400f0870..d1913d39 100644 --- a/rest_framework_json_api/filters.py +++ b/rest_framework_json_api/filters.py @@ -69,7 +69,7 @@ class QueryParameterValidationFilter(BaseFilterBackend): the rules at http://jsonapi.org/format/#query-parameters. """ #: compiled regex that matches the allowed http://jsonapi.org/format/#query-parameters: - #: `sort` and `include` stand alone; `filter`, `fields`, and `page` have []'s + #: `sort`, `include` and `format` stand alone; `filter`, `fields`, and `page` have []'s query_regex = re.compile(r'^(sort|include|format)$|^(filter|fields|page)(\[[\w\.\-]+\])?$') def validate_query_params(self, request):