Hacker News new | ask | show | jobs
by acemarke 2069 days ago
What's your preferred tool for generating TS API clients? I tried the official `openapi-generator` tool last year, but was horrified to see that a fairly small API file resulted in 5000 lines of boilerplate TS code that was trying to provide multiple levels of overrides and abstraction for configuring the calls.
1 comments

I don't actually generate clients. I generate data types for requests and responses, which I then use with regular HTTP clients.

I'm sure there are some client generators out there that work well and create lean code, but it's easy enough to use off-the-shelf HTTP clients with some additional type guards.

This is the tool I use most often for TypeScript: https://github.com/horiuchi/dtsgenerator