| review_agents |
|
||||
|---|---|---|---|---|---|
| plan_review_agents |
|
src/lib/openapi/is build-time only.@asteasolutions/zod-to-openapiis a devDependency. ESLintno-restricted-importsblocks runtime code from importing@/lib/openapi/*. Files withinsrc/lib/openapi/can import each other. Do not flag this as a missing runtime dependency.- Zod schemas live in a colocated
schema.tsnext toroute.ts, not inline. OpenAPI registration and mutation hooks import fromschema.ts, neverroute.ts. This breaks the transitive import chain to handler dependencies. - Endpoint registration uses a barrel export in
src/lib/openapi/endpoints/index.ts. The generation script auto-discovers viaObject.values(). Adding a new endpoint requires aregister*()function + barrel re-export. @scalar/nextjs-api-referenceis correctly independencies(not devDeps) — it's imported at runtime bysrc/app/api-docs/route.ts.public/openapi.jsonis gitignored and generated pre-build viaprebuild:nextlifecycle script. Do not flag it as a missing committed file.
PUBLIC_PATHSis a plainas constarray, not a Set.isPublicPath()uses.some()withstartsWithprefix matching. Nohas()is needed — do not suggest converting to Set./api-docsis explicitly inPUBLIC_PATHS. It is also excluded from middleware by the matcher regex, but the explicit entry is intentional as defense-in-depth.