Skip to content

fix(jsonapi): normalize symfony-rendered errors - #8731

Merged
soyuka merged 3 commits into
api-platform:5.0from
soyuka:fix/jsonapi-router-errors-8704
Oct 22, 2026
Merged

soyuka merged 3 commits into
api-platform:5.0from
soyuka:fix/jsonapi-router-errors-8704

Conversation

@soyuka

@soyuka soyuka commented Oct 19, 2026

Copy link
Copy Markdown
Member
Q A
Branch? 4.4
Tickets Part of #8704
License MIT
Doc PR ∅

When an error is rendered by Symfony's error controller (handle_symfony_errors: false, the default, or an operation with _api_error_handler: false), the JSON:API ErrorNormalizer received a FlattenException and only kept a generated id, so 404/405 router errors had an empty error object. The members are now built from the FlattenException and go through the same tail as the item path, so the 5.x string status cast applies after merge-up. detail is the status text unless debug is on, same as Symfony's ProblemNormalizer.

The top-level type member from #8704 is left as is here, its removal is a separate patch on main.

Symfony's error renderer hands a FlattenException to the JSON:API
ErrorNormalizer, which delegated to the item normalizer and kept only
a generated id. Build the error members from the FlattenException and
run them through the same tail as the item path.

Refs api-platform#8704
@soyuka
soyuka force-pushed the fix/jsonapi-router-errors-8704 branch from ed11fa0 to 1e0fb15 Compare October 22, 2026 06:33
@soyuka
soyuka changed the base branch from 4.4 to 5.0 October 22, 2026 06:33
@soyuka
soyuka force-pushed the fix/jsonapi-router-errors-8704 branch from 1e0fb15 to 45c297c Compare October 22, 2026 07:00
@soyuka
soyuka merged commit 5974d94 into api-platform:5.0 Oct 22, 2026
117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant