dify/api/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 fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038) 2026-06-10 07:28:12 +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
mcp chore: reorg imports (#35308) 2026-04-16 08:50:02 +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: support custom trace session id for Phoenix tracing (#37056) 2026-06-04 08:42:03 +00:00
trigger refactor(api): type webhook data extraction with RawWebhookDataDict TypedDict (#34486) 2026-04-03 02:24:17 +00: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 chore(api/controllers): Apply Ruff Formatter. (#7645) 2024-08-26 15:29:10 +08:00
API_SCHEMA_GUIDE.md refactor(api): migrate console.app.workflow to BaseModel (#36216) 2026-05-18 07:31:37 +00:00
fastopenapi.py chore(api): Fix several typing errors (#37119) 2026-06-06 01:44:32 +00:00