📌 Description
src/openapi.ts is hand-maintained per the README ("hand-maintained OpenAPI-shaped description"), which means it can silently drift from the real routes registered in createApp() (src/app.ts). openapi.test.ts validates the spec's own shape but not that it actually reflects the live route table.
🧩 Requirements and context
- Walk the Express app's registered routes (via its internal router stack, or a small introspection helper) and compare method+path pairs against the paths declared in
buildOpenApiSpec().
- Fail the test if a route exists without a spec entry, or a spec entry references a route that no longer exists.
- Keep the check resilient to path-param syntax differences (
:id vs {id}).
🛠️ Suggested execution
- Add a route-introspection helper (test-only) that lists
{method, path} from createApp().
- Add the comparison test to
src/openapi.test.ts.
- Fix any drift the new test uncovers.
✅ Acceptance criteria
🔒 Security notes
Indirectly reduces risk of undocumented/forgotten routes escaping review.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
src/openapi.tsis hand-maintained per the README ("hand-maintained OpenAPI-shaped description"), which means it can silently drift from the real routes registered increateApp()(src/app.ts).openapi.test.tsvalidates the spec's own shape but not that it actually reflects the live route table.🧩 Requirements and context
buildOpenApiSpec().:idvs{id}).🛠️ Suggested execution
{method, path}fromcreateApp().src/openapi.test.ts.✅ Acceptance criteria
🔒 Security notes
Indirectly reduces risk of undocumented/forgotten routes escaping review.
📋 Guidelines