Skip to content

When the backend breaks the contract

Rename title to headline in the Nest backend’s CreatePostDto, regenerate the client and run pnpm typecheck:

tests/readme.test.ts(20,53): error TS2353: Object literal may only specify known properties, and 'title' does not exist in type 'CreatePostDto'.

Every test that sends the old field fails to compile, with the file and line. No test run, no backend needed.

That’s why the gotchas say: regenerate after every change of the spec, run pnpm typecheck in CI and commit eberly/generated.ts.

Privacy-friendly analytics, no cookies.