Skip to content

docs: document routePriority and CSP nonce (5.0) - #2331

Merged
soyuka merged 1 commit into
api-platform:mainfrom
soyuka:docs/5.0-route-priority-csp-nonce
Sep 13, 2026
Merged

docs: document routePriority and CSP nonce (5.0)#2331
soyuka merged 1 commit into
api-platform:mainfrom
soyuka:docs/5.0-route-priority-csp-nonce

Conversation

@soyuka

@soyuka soyuka commented Sep 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Documents routePriority (core#8309, corrected by core#8529) in core/operations.md: an operation-level option that controls Symfony route matching order, with a worked example of a static /books/featured route colliding with /books/{id}. Explicitly disambiguated from the pre-existing priority option, which sorts in the opposite direction and serves a different purpose (operation-list ordering, e.g. IRI generation) — the two were split in #8529 specifically because #8309 initially reused priority for routing.
  • Documents the CSP nonce support on Swagger UI (core/openapi.md) and GraphiQL (core/graphql.md) added in core#8310, cross-linking the two sections instead of duplicating the explanation. Precedence confirmed against tests/Functional/SwaggerUiCspNonceTest.php and tests/Functional/GraphQl/GraphiqlCspNonceTest.php: the _csp_nonce request attribute wins over a Twig csp_nonce() function (e.g. NelmioSecurityBundle), and if neither is present no nonce attribute is emitted. Both features are Symfony-only on main (verified: src/Symfony/Bundle/SwaggerUi/SwaggerUiProcessor.php and the Symfony-registered GraphiQlAction; Laravel's Swagger/GraphiQL views are untouched by core#8310).

Both features are 5.0-only (main); verified absent from upstream/4.4.

Test plan

  • npx prettier@3.9.5 --check on the three touched files passes (whole-repo check shows only pre-existing, unrelated failures in core/doctrine-filters.md / core/filters.md, files not touched by this PR)
  • Claims verified against api-platform/core upstream/main source (src/Metadata/Operation.php, src/Symfony/Routing/ApiLoader.php, vendor/symfony/routing/RouteCollection.php, src/GraphQl/Action/GraphiQlAction.php, src/Symfony/Bundle/SwaggerUi/SwaggerUiProcessor.php)

@soyuka
soyuka force-pushed the docs/5.0-route-priority-csp-nonce branch from a0d8988 to 9e702ab Compare September 13, 2026 07:40
@soyuka
soyuka merged commit abef0c7 into api-platform:main Sep 13, 2026
3 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