This post will use axios and express for the API client and server libraries respectively. The first step is to realize that your API client library and server framework already support type parameters. This is a very lightweight and pragmatic API spec. It’s not always a good idea to colocate your application model types, like User, with their respective API contracts.
Table of contents
What & WhyUnderstand Your Type ParametersType Parameters: AxiosType Parameters: ExpressExtracting a TypeScript API specIntegrating with the API specThe ResultConclusionSort: