Repository navigation
fix(api): correct static route precedence guidance - #1860
Open
misaelalves99 wants to merge 1 commit into
Open
misaelalves99 wants to merge 1 commit into
misaelalves99 wants to merge 1 commit into
Conversation
joshunrau
requested changes
Nov 4, 2026
joshunrau
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, this is a clean fix. The corrected paragraph matches find-my-way's documented match order, and the new controller test shows it: the test boots the reordered controller on Fastify, and when I renamed the static route, the request fell through to :id and the test failed as it should.
One change before merge:
- Please change the commit type from
fixtorefactor(ordocs). This repo buildsCHANGELOG.mdand the published changelog page in the user docs from commit subjects. Everyfixcommit becomes a "Bug Fixes" entry (scripts/changelog.ts:122), and PRs are merged with merge commits, so your commit message lands there as it is. This PR corrects documentation and reorders the controller's methods without changing any behaviour, so it should not appear to users as a bug fix. Rewording the commit to, for example,refactor(api): drop the route-order lint exemption the router never needed(withgit commit --amendand a force-push) is enough. Please update the PR title to match.
Reviewed at commit 18226c1.
This branch has not been deployed
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.
Summary
Closes #1834.
Correct the API documentation's assumption that a parameterized route can shadow a static route registered after it. Fastify prioritizes static routes regardless of declaration order.
Changes
apps/api/AGENTS.mdto document Fastify's static-route precedence.perfectionist/sort-classesexemption fromInstrumentRecordsControllerand restore lint-compatible method ordering./instrument-records/linear-modelreaches the static handler instead of/:id.Validation
Focused local validation against upstream
mainata1cdbab8ecabe050ebd2af5c8133bd33dc24baa9:No dependencies or database schema changes were introduced.
Scope: Full monorepo lint, coverage and E2E suites were not run locally. Focused validation does not imply full CI approval.