The platform's routes go first, so nothing has to be policed - #133
Merged
czpython merged 1 commit intoJul 27, 2026
Merged
Conversation
czpython
force-pushed
the
commonzenpython/eng-779-platform-routes-mount-first
branch
from
July 27, 2026 15:11
14a953b to
eac9a76
Compare
czpython
enabled auto-merge (squash)
July 27, 2026 15:12
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.
The guard #131 added to keep an extension out of the subject namespace read every declared route's path and compared it to the segment. Both halves of that were wrong.
parent.include_router(child)leaves a lazily-flattened entry behind that carries nopathat all, so an extension composing its own routers stopped loading:And a path string was never enough to decide the question.
@router.get("/{resource}")names no segment and still answers/api/x/widget; amount("/", …)has no path to read. Inspection cannot tell whether a route will match a segment — only routing can.So the platform stops asking and simply goes first:
Both platform routers are confined to their own segment, so matching them first takes nothing from an extension anywhere else and leaves it no way to take a read druks serves — not with a catch-all, not by composing routers, and not by overriding
get_routersto put its own first. The guard, its exception and the two tests that policed spelling are gone; what replaces them is a request proving a{anything:path}route still loses/widgetand still wins everything else.One collision inspection did have to keep:
transcriptsis the segment every extension's agent-call reads live on, so a subject of that name is refused where the extension is declared, not where it would have been confusing.The convention this documented was also written down wrong.
night_watchandpull_requestare snake_case and both are URL segments — what the spelling tells you is who owns the segment, not whether it is a URL. Andusagestill declared the tag the platform now stamps, so every one of its operations carried it twice.