🚀 The Black Box Principle: Decoupling API Clients with OpenAPI and TypeScript
dev.to·15h·
Discuss: DEV
Flag this post

When I was primarily a frontend engineer, I had a terrible relationship with APIs. If I wasn’t manually rewriting types and interfaces from the backend, I was debugging runtime errors because someone changed an endpoint without telling me.

Back then I read the following advice:

‘The best way to get types from the server was to get the types from it.’

What I didn’t realize was this was some of the worst advice I’ve ever received; until I became the backend engineer responsible for maintaining both sides.

The code you’re about to see isn’t a hypothetical example. It’s the actual technical debt that almost burned me out as a solo engineer building a startup.

I didn’t understand how the backend was supposed to work in a real world environment.

**So this is what I came up with:…

Similar Posts

Loading similar posts...