Skip to content

feat: reject unknown query parameters on statistics and payloads. Closes #1755 - #1807

Merged
regulartim merged 1 commit into
GreedyBear-Project:developfrom
kikiscodedeliveryservice:feat/unserialized-views-query-params
Nov 3, 2026
Merged

regulartim merged 1 commit into
GreedyBear-Project:developfrom
kikiscodedeliveryservice:feat/unserialized-views-query-params

Conversation

@kikiscodedeliveryservice

Copy link
Copy Markdown
Contributor

Description

Follow-up to #1688. Statistics and payloads still silently ignored unknown query params, because neither had a request serializer for QueryParamValidationMixin to check against. They now return a 400 like the other endpoints.

Statistics gets a StatisticsRequestSerializer for range, which now also does the range parsing, so errors for a bad range name the field. On payloads, serializer_class is the response serializer, so the viewset overrides get_allowed_query_params() instead: the list accepts page, page_size and paginate, and retrieve and download accept nothing.

Related issues

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Chore (refactoring, dependency updates, CI/CD changes, code cleanup, docs-only changes).

Checklist

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop.
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behavior that is described in the docs. If so, I also included an update to the wiki in the description of this PR.
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

Wiki update

In the Payloads API section of the Usage page, each endpoint's Responses list could get one more line, right after the 200 one.

List Payloads:

  • Response (400): Bad Request - a parameter other than page, page_size or paginate was given.

Retrieve a Payload and Download a Payload:

  • Response (400): Bad Request - a parameter was given, but this endpoint doesn't take any.

@regulartim regulartim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kikiscodedeliveryservice ! This looks very good, thank you!

@regulartim
regulartim merged commit 416b93a into GreedyBear-Project:develop Nov 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants