Skip to content

fix(symfony): register docs and jsonld routes in api_platform_iris mode - #8745

Open
brunobg wants to merge 1 commit into
api-platform:4.4from
brunobg:fix/iris-loader-jsonld-routes
Open

brunobg wants to merge 1 commit into
api-platform:4.4from
brunobg:fix/iris-loader-jsonld-routes

Conversation

@brunobg

@brunobg brunobg commented Oct 19, 2026 •

Copy link
Copy Markdown
Q A
Branch? 4.4, as asked in #7915 (happy to retarget 5.0)
Tickets Closes #7915
License MIT
Doc PR n/a

With jsonld in formats (the default), a 404 on an item route registered by the api_platform_iris loader became a 500. The JSON-LD error normalizer and HydraLinkProcessor generate api_jsonld_context and api_doc, and the iris loader only loaded genid.php. It now also loads docs.php and jsonld.php when jsonld is enabled, as the regular loader does.

Test: tests/Functional/IrisRoutesTest.php boots a new iris kernel env (routing_iris.yml loads only api_platform_iris) and checks that GET /iris_dummies/1 with Accept: application/ld+json returns a 404 JSON-LD error. Before the fix it throws RouteNotFoundException: Unable to generate a URL for the named route "api_jsonld_context". ApiLoaderTest covers iris mode with and without jsonld.

🤖 Generated with Claude Code

With jsonld enabled, a JSON-LD error on a not exposed route (a 404 on an
item route registered by `api_platform_iris`) generated `api_jsonld_context`
and `api_doc`, which the iris loader did not register, so the 404 became a
500. Load `docs.php` and `jsonld.php` when jsonld is enabled, as the regular
loader does.

Closes api-platform#7915

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brunobg brunobg mentioned this pull request Oct 19, 2026
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