7. Regenerate the OpenAPI spec
The canonical openapi.json at the repository root is the contract: regenerate it after any controller, schema, or DTO change, and never hand-edit it.
cd backend
npm run build
npx ts-node -r tsconfig-paths/register scripts/dump-openapi.ts
# emits openapi.runtime.json in cwd; copy to canonical:
cp openapi.runtime.json ../openapi.json
rm openapi.runtime.json
CI's OpenAPI drift job re-runs the dump and diff -us it against the canonical file, so a stale spec fails the build.