Type-Safe APIs - Syncing Back & Front End Types w/ Code Generation
summary
Claim: generate TypeScript API clients from backend OpenAPI/Swagger specs so front and back share one source of truth. Uses Springfox to emit specs, openapi-generator (the openapi-generator npm package) to produce axios/TypeScript clients, and publishes them as npm packages with CI & NPM versioning so multiple apps consume the same types. Outcome: builds fail fast when contracts change, IDEs get accurate completions, and POLITICO reports much less hand-rolled syncing pain when microservices evolve.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:05TYPE-SAFE APIS Syncing Back & Front End Types w/ Code Generation
- 1:452. A Remedy Type sharing w/ code generation
- 8:02how is it documented?
- 14:49A REMEDY Type sharing w code generation
- 17:01API Specification Describes endpoints, params, & responses
related talks
33mTypeScript for APIs
33mEnd-to-End Type Safety with Swagger and TypeScript
24mReliable I/O with the TypeScript Compiler API
39mEnd to end typing for web applications
34mGenerating Types without climbing a tree
31mBuilding an OpenAPI from Typescript
10mEnd-to-end Type Safety
06mAutomagic TypeScript Codegen for GraphQL
