dify - 💡(How to fix) Fix Service API annotations list silently falls back for invalid pagination query values [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Invalid explicit page or limit query values should be rejected with a validation error, consistent with other Service API endpoints that validate pagination query parameters. As a result, requests such as page=abc or limit=abc silently fall back to the default pagination values and continue to call the annotation list service, instead of returning a validation error.

Fix Action

Fixed

Code Example

curl -H "Authorization: Bearer <app-api-key>" \
  "<dify-host>/v1/apps/annotations?page=abc&limit=20"
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

main branch, latest as of 2026-05-29

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Create or use an app with Service API access enabled.
  2. Send a request to the annotations list endpoint with an invalid explicit pagination value, for example:
curl -H "Authorization: Bearer <app-api-key>" \
  "<dify-host>/v1/apps/annotations?page=abc&limit=20"

The same issue can be reproduced with values such as page=, page=0, page=-1, or limit=abc.

Expected Behavior

Invalid explicit page or limit query values should be rejected with a validation error, consistent with other Service API endpoints that validate pagination query parameters.

Missing pagination parameters should still use the existing defaults (page=1, limit=20). Valid numeric strings such as page=2&limit=5 should continue to work.

Actual Behavior

GET /v1/apps/annotations currently reads pagination with Flask request.args.get(..., type=int). When an explicit value cannot be parsed as an integer, Flask returns the default value instead of treating the value as invalid.

As a result, requests such as page=abc or limit=abc silently fall back to the default pagination values and continue to call the annotation list service, instead of returning a validation error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

dify - 💡(How to fix) Fix Service API annotations list silently falls back for invalid pagination query values [1 pull requests]