schema drift
Copies of the same data shape slowly becoming different as one is changed and the others are forgotten.
In more detail
Hand-written DTOs and client types drift away from the entity or the API. Deriving types from a single source, with utility types or generated code, removes the copies.
Related terms
- DTO — A plain object whose only job is to carry data across a boundary, such as the body of an API request or response.
- single source of truth — The one agreed place where a piece of information is maintained, so every copy is generated from it rather than edited by hand.
- code generation — Producing client or server code automatically from a machine-readable contract such as an OpenAPI document or a Protocol Buffers file.
Taught in
- Primitive Types: String, Number, Boolean, Bigint And Symbol — Production TypeScript
- Exhaustive Narrowing With never In Production Handlers — Production TypeScript
- Core Utilities: Partial, Required, Readonly, Pick And Omit — Production TypeScript