contract-driven development
Agreeing on the exact shape of the data two parts of a system exchange first, and building both sides against that agreement.
In more detail
In TypeScript a contract is an interface or type that both caller and implementation must satisfy. Across services, the contract is usually an OpenAPI document from which both sides get their types.
Related terms
- OpenAPI — A standard, language-neutral format for describing an HTTP API: its paths, operations, parameters, request and response schemas, errors and security.
- interface (TypeScript) — In TypeScript, a named description of an object's shape: which properties it has and their types.
- 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
- Why TypeScript: Contracts, Erased Types And Soundness — Production TypeScript
- Type Annotations, Type Inference And Contextual Typing — Production TypeScript
- Verify Your Environment: Running tsc And Bun TypeScript — Production TypeScript
- Literal Types: String, Number, Boolean Literals And const — Production TypeScript
- any Versus unknown: Defensive Typing In Practice — Production TypeScript
- Type Aliases Versus Interfaces: Declaration Merging — Production TypeScript
- Union Types, Intersections And Property Conflicts — Production TypeScript
- Custom Type Predicates: Functions Returning is Type — Production TypeScript
- Why Generics: Functions, Identities And Type Variables — Production TypeScript
- Generic Interfaces, Classes And Type Aliases — Production TypeScript
- Generic Constraints: extends, keyof And Indexed Access — Production TypeScript
- Default Generic Arguments And Multi-Type Parameters — Production TypeScript
- Const Type Parameters: Retaining Literal Types In Functions — Production TypeScript
- Core Utilities: Partial, Required, Readonly, Pick And Omit — Production TypeScript
- Mapped Types, Key Remapping With as And Template Literals — Production TypeScript
- Declaration Files, Ambient Namespaces And Module Augmentation — Production TypeScript
- The satisfies Operator: Safe Validation Without Widening — Production TypeScript
- The Spine Artifact: Generating Typed Models From OpenAPI — Production TypeScript