Skip to content

fix(api): validate annotation list pagination query#36807

Merged
fatelei merged 2 commits into
langgenius:mainfrom
WOLIKIMCHENG:fix/annotation-pagination-validation
May 29, 2026
Merged

fix(api): validate annotation list pagination query#36807
fatelei merged 2 commits into
langgenius:mainfrom
WOLIKIMCHENG:fix/annotation-pagination-validation

Conversation

@WOLIKIMCHENG
Copy link
Copy Markdown
Contributor

Summary

Fixes #36805

Validate GET /v1/apps/annotations query parameters with a Pydantic query model instead of relying on Flask request.args.get(..., type=int) fallback behavior.

This makes invalid explicit page and limit values fail validation instead of silently using defaults, while preserving the existing default pagination values and valid numeric string support. The query model is also used to document Swagger query parameters.

Screenshots

Before After
N/A N/A

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 45.74% 45.75% +0.01%
Strict coverage 45.27% 45.28% +0.01%
Typed symbols 24,621 24,633 +12
Untyped symbols 29,512 29,512 0
Modules 2760 2760 0

@autofix-ci autofix-ci Bot requested a review from crazywoola as a code owner May 29, 2026 05:44
@github-actions github-actions Bot added the web This relates to changes on the web. label May 29, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 29, 2026
@fatelei fatelei added this pull request to the merge queue May 29, 2026
Merged via the queue into langgenius:main with commit c530a5d May 29, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service API annotations list silently falls back for invalid pagination query values

2 participants