Comment by supriyo-biswas

6 hours ago

The OpenAPI autogenerated clients kinda suck though.

My preferred approach for doing this is to have a hand-rolled SDK generator that reads the request, response and error models out of the microservice project and emits the same in each language targeted by the SDK, along with a minimal stub that calls the API.

You then spend 15 minutes at most, customizing the stub if needed, if you need custom behaviours like streaming.

Not talking about the generated clients, I'm talking about the spec itself. If the majority of API services don't even have an OpenAPI spec, they can't use tools like Stainless even if they wanted to. A lot is being left on the table by not working on that first issue: companies don't have an OpenAPI spec. Been on my mind to explore that issue, because I run one of those API services that don't have an OpenAPI spec, but I have other priorities pulling my attention away from that. I just wish it was all handled.

  • I generally recommend FastAPI, their OpenAPI generation isn’t always perfect if you have very polymorphic endpoints but it is really good compared to other tools I experienced. And is just a neat library that has been battle tested