dify/api/controllers/console/datasets
Yufeng He 4e99a98c23 fix(datasets): validate console dataset list pagination as >= 1
ConsoleDatasetListQuery accepted any integer page/limit, so a negative or zero
value passed straight through to DatasetService.get_datasets and on to the DB
pagination. The annotation list queries already guard this with Field(ge=1)
(both console and service_api); apply the same bound to the console dataset
list query for consistency.

Add unit tests covering the defaults, a valid page/limit, and rejection of
non-positive page and limit.

From Claude Code.

Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
2026-06-18 16:12:53 +08:00
..
rag_pipeline test: example of make db.session pass from parameter. #37403 (#37471) 2026-06-16 04:07:01 +00:00
data_source.py refactor(api): migrate tenant/user via DI for several endpoints (#37026) 2026-06-04 05:52:59 +00:00
datasets_document.py refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
datasets_segments.py refactor(api): migrate tenant/user via DI for several endpoints (#37026) 2026-06-04 05:52:59 +00:00
datasets.py fix(datasets): validate console dataset list pagination as >= 1 2026-06-18 16:12:53 +08:00
error.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
external.py refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
hit_testing_base.py refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
hit_testing.py refactor(api): migrate remaining console APIs to use injected user/tenant (#37288) 2026-06-11 01:30:31 +00:00
metadata.py refactor(api): migrate remaining console APIs to use injected user/tenant (#37288) 2026-06-11 01:30:31 +00:00
website.py refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
wraps.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00