Traditional vs API-first
- Traditional: code the backend → document what was built → frontend adapts
- API-first: design the API → everyone agrees → backend and frontend develop in parallel
Benefits
- Frontend can start immediately — a mock server is generated from the OpenAPI spec
- Design problems are found early, before any code is written
- Automatic generation of SDKs, documentation, and tests from the contract
- Easier versioning — the contract is versioned in Git
Tools
OpenAPI 3.x → Swagger UI (docs), Prism (mock server), OpenAPI Generator (SDK). Stoplight, Postman — for API design.