Make the API contract the source of truth and generate TypeScript clients/types from an OpenAPI document in CI. A breaking schema change should fail the consumer build before deployment. Example: // generated usage const order: OrderDto = await client.orders.getById(id); Keep generated files read-only and wrap them with small application adapters. Use nullable/required annotations consistently, stable enum serialization, and contract tests for important examples. Publish versioned specs and compare them for breaking changes in CI. During rolling releases, use additive changes first: deploy tolerant readers, then writers, migrate stored data if needed, and remove old fields only after every consumer has moved.
Backbencher Developer · · 0 likes