You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
apps/api AGENTS.md says a :id route shadows a single-segment route, but Fastify matches static routes first #1834
apps/api/AGENTS.md ("Adding a feature module") says a single-segment route such as @Get('summary') can be shadowed by @Get(':id') on the same verb. perfectionist/sort-classes
orders handlers alphabetically, so a fixed route can end up declared below :id. The doc tells
readers to give such routes two segments.
The API runs on @nestjs/platform-fastify, whose router is find-my-way. Its README ("Match order")
matches a static node before a parametric one, whatever order the routes were registered in:
static
parametric node with static ending
parametric(regex)/multi-parametric
parametric
wildcard
So GET /v1/instrument-records/linear-model should reach @Get('linear-model') even when it is
declared below @Get(':id'). An ad-hoc Fastify check during the lint cleanup on the linting branch
found the same, but it was not committed.
If a request-level test confirms it
Correct the paragraph in apps/api/AGENTS.md.
Remove the file-level perfectionist/sort-classes disable at the top of apps/api/src/instrument-records/instrument-records.controller.ts. It exists only to keep @Get('linear-model') above @Get(':id'), and without it the handlers can sort.
Activity