dify/api/tests/unit_tests/controllers
GareArc f5c5dbaed5
feat(openapi): emit canonical ErrorBody on every /openapi/v1 error path
Install OpenApiErrorFormatter on the openapi blueprint's ExternalApi so
all non-2xx responses from /openapi/v1 carry the canonical ErrorBody shape
(code, message, status, optional details/hint). RFC 8628 device-flow
endpoints are unaffected — their flat {error: ...} shape is passed through
unchanged.

Also: set catch_all_404s=True when a formatter is present so unknown
routes return canonical JSON 404s (not Flask's default HTML 404).
Override _help_on_404 to suppress route suggestions, which would corrupt
the JSON contract and enumerate routes to unauthenticated callers.

Both behaviours are scoped by formatter presence — other blueprints that
construct ExternalApi without error_body_formatter are byte-identical.

Wire-level tests added to TestWireContract (3 tests, 18 total):
- 422 from @accepts validation carries code/status/details
- unknown-route 404 is canonical JSON without route suggestions
- device token POST returns RFC 8628 flat shape untouched by formatter
2026-06-10 02:48:38 -07:00
..
common refactor(api): migrate console/service_api.dataset.segment to BaseModel (#36522) 2026-05-30 13:54:01 +00:00
console fix(plugin): align plugin list endpoint counts with live endpoint state (#37179) 2026-06-10 08:11:11 +00:00
files feat(dify-agent): sync shell and back proxy updates (#37159) 2026-06-10 03:04:32 +00:00
inner_api feat(dify-agent): sync shell and back proxy updates (#37159) 2026-06-10 03:04:32 +00:00
openapi feat(openapi): emit canonical ErrorBody on every /openapi/v1 error path 2026-06-10 02:48:38 -07:00
service_api feat(dify-agent): sync shell and back proxy updates (#37159) 2026-06-10 03:04:32 +00:00
trigger fix: clarify webhook debug endpoint behavior (#33597) 2026-03-18 14:28:33 +08:00
web fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038) 2026-06-10 07:28:12 +00:00
__init__.py feat: return data_source_info and data_source_detail_dict (#29912) 2026-01-05 11:04:03 +08:00
test_compare_versions.py refactor(version): simplify version comparison logic (#10109) 2024-10-31 15:15:32 +08:00
test_conversation_rename_payload.py fix: conversation rename payload validation (#29510) 2025-12-11 18:05:41 +09:00
test_swagger.py fix(web): use generated account-profile contracts (#36927) 2026-06-02 07:28:05 +00:00