mirror of
https://github.com/langgenius/dify.git
synced 2026-05-20 16:57:01 +08:00
Replaces ad-hoc int(request.args.get(...)) parsing in AppListApi.get with a typed Pydantic query model. Bad inputs (page=abc, limit=-1, limit=500, mode=invalid, missing workspace_id) raise ValidationError which the handler converts to 422 with field-level error detail instead of 500 / silent empty page. Closes the mode whitelist via AppMode enum. Verified via direct unit tests on AppListQuery (no HTTP integration tests required since the model carries the validation contract).