Skip to content

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

Open
soyuka wants to merge 3 commits into
api-platform:4.4from
soyuka:fix/jsonapi-router-errors-8704
Open

soyuka wants to merge 3 commits into
api-platform:4.4from
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
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