EVA-3177: strip query string from endpoint path when registering routes - #18
Merged
Merged
Conversation
Endpoint paths may contain a query string template (e.g.
"/v1/cars?ids={ids}") that API clients use to build request URIs.
Symfony matches routes against the path info only, so a route
registered with the query string in its path can never match.
Strip everything from "?" onward before creating the route. Request
DTO population is unaffected: ServiceRequestResolver already reads
query parameters from the actual request.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aivus
force-pushed
the
EVA-3177-strip-query-string-from-routes
branch
from
July 6, 2026 18:32
79421d5 to
ad87acb
Compare
fpradas
approved these changes
Jul 7, 2026
aviator-ua
reviewed
Jul 7, 2026
Use the concrete Endpoint DTO instead of prophesizing EndpointInterface (it is just a DTO), and remove the UrlMatcher-based test which exercised Symfony routing rather than EndpointLoader itself. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
aviator-ua
approved these changes
Jul 13, 2026
dmitry-auto1
approved these changes
Jul 13, 2026
alex-sun
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Endpoint paths generated from OpenAPI specs may contain a query string template, e.g.
This template is load-bearing for API clients (
service-api-client-bundlebuilds request URIs by substituting the{...}placeholders), butEndpointLoaderpassed it verbatim into the SymfonyRoute. Symfony matches routes against the path info, which never contains a query string, so such a route can never match — requests to/v1/itemsreturn 404:Fix
Strip everything from
?onward from the endpoint path before registering the route.Request DTO population is unaffected:
ServiceRequestResolveralready reads query parameters from the actual request ($request->query->all()), not from the route path.Tests
New
Tests/Routing/EndpointLoaderTest.php:/v1/cars/{id}) are preservedUrlMatcherRef: EVA-3177
🤖 Generated with Claude Code