def check_query_parameters(self, queryset):
        query_parameters = set(self.request.GET.keys())

        # All query paramters must be either a field or an operation
        allowed_query_parameters = set(self.get_available_fields(queryset.model)).union(self.known_query_parameters).union({'id'})
        unknown_parameters = query_parameters - allowed_query_parameters
        if unknown_parameters:
            raise BadRequestError("query parameter is not an operation or a recognised field: %s" % ', '.join(sorted(unknown_parameters)))
Ensure that only valid query paramters are included in the URL.
dataset/ETHPy150Open torchbox/wagtail/wagtail/api/v2/endpoints.py/BaseAPIEndpoint.check_query_parameters