Live data from Hacker News

The Stainless SDK Generator

stainlessapi.com

51–60 of 67 posts

Re: The Stainless SDK Generator

#51
post #49
post #46

Earlier quoted context omitted.

Never been a fan of code-gen solutions that generates both DTOs and client proxies which IMO promotes a lot of fragile code-gen that's less resilient to changes. The solution we've adopted in ServiceStack to solve this with minimal code generation and better reusability is to only generate the message-based Typed DTOs for each language but have them able to be used by the same generic JSON ServiceClient. This approac…

That's interesting — the typed request and response objects that you get with an API SDK are certainly one of the biggest upsides, and I certainly see the benefit of having full control of the transport layer yourself so that you can add any common telemetry / logging / statistics at your leisure. On the other hand, a benefit of a more complete API is that in typed languages you can tab-complete your way to success.…

Sending Messages also have many benefits over RPC methods [1] that's especially important for evolvable APIs across process boundaries.

The DTOs are still typed so you still get AutoComplete that also include API Docs and Type hints in the generated DTOs since we full control how DTOs are generated and we're able to capture richer type information in the server C# DTOs (used as blueprints to generate DTOs in different languages).

All the information about how to call the API and what it returns is captured in the Request DTOs, and the only thing the Service Clients need is the BaseUrl for where the APIs are hosted. So you could create a higher level SDK client that just needs to inherit the Service Client and hard code its URL, e.g:

class MyClient : JsonServiceClient(BaseUrl) {}

Where they'll also be able to add any helper methods specific to their APIs (e.g. Custom Auth). For the trade-off of not being able to reuse that client to call different APIs and endpoints, but will still share the same base class so you could still create reusable functionality that can be shared across all Service Clients.

[1] https://docs.servicestack.net/advantages-of-message-based-we...

Re: The Stainless SDK Generator

#52
post #44

How do you guys differ against https://www.speakeasyapi.dev and https://www.buildwithfern.com and https://liblab.com ?

We've recently evaluated all four platforms—Stainless, Fern, Speakeasy, and Liblab—and here are our key takeaways: Stainless: The standout for maturity and idiomatic code generation. While method signatures across products may look the same, Stainless shines during developing & debugging - making their codebase easier to navigate. They have a practical separation of SDK configuration from OpenAPI specification, setti…

When you say it shines during development and debugging - can you provide examples of what types of problems it solved?

Re: The Stainless SDK Generator

#54
Congratulations to Alex and the team. After chatting with them recently at a NYC meet-up, you can tell they live and breathe client SDK generation. They are thoughtful about creating an excellent experience for those generating SDKs (Stainless Studio) and those consuming them. Good luck!

Re: The Stainless SDK Generator

#55
Out of curiosity how difficult has it been hosting OpenAI's SDK? Is there one off stuff that goes into that? Their API seems really challenging - SSE's, tons of complex generics, async, docs - it's endless.

Really impressive stuff, I can't imagine doing all this with a team as lean as yours.

Re: The Stainless SDK Generator

#56
post #47

Earlier quoted context omitted.

That one only does Go, but it is just one of many OpenAPI generators. I used openapi-generator and was able to produce SDKs for TypeScript (angular and node), Dart (Flutter), Kotlin (andoird), and Swift (iOS). They worked great for our purposes and I really had no complaints or issues. I guess my question is, what is the key differentiator that Stainless offers above just using OpenAPI and its huge library of existin…

If it works great for you, that's great – stick with it! From what I've seen, a lot of API developers find that openapi-generator flat-out breaks or produces broken code for their OpenAPI spec (varies language-to-language of course). Beyond hitting the "it just works" mark more often, some other key differentiators: 1. much easier to configure & customize 2. auto-retry with exponential backoff (this is huge for our c…

Very helpful. Thanks for the details.

Re: The Stainless SDK Generator

#58
post #36

Lots of these have been popping up lately, they all seem really good. This is the first one I've seen with an answer for "I want to customize the output by hand", which is neat. https://buildwithfern.com/ https://liblab.com/ https://www.speakeasyapi.dev/ Between this and fancy API doc generators (Mintlify, etc.), I feel like we're finally getting close to being able to just go from OpenAPI to Stripe-level "polish".

We have to improve our docs a lot, but yes, that’s the goal! You as a stainless user should feel empowered and in control :)

Re: The Stainless SDK Generator

#59
Congratulations to Alex and team! Had the pleasure of working with Alex on SDK generators back in 2019 and 2020 and it's very exciting to see these ideas and the fruits of this become available to the entire world. Stainless would definitely be where I looked first if I were starting a developer-facing SaaS today.

Re: The Stainless SDK Generator

#60
Congratulations to the Stainless team on a fantastic launch! I'm one of the co founders of Speakeasy (https://www.speakeasyapi.dev/). We do similar things in the SDK space and some other things too.

I resonate with a lot of what is said in the comments. Last mile API tooling is underrated and most companies don't have the deep API platform expertise to build from scratch. The OSS options in the space proved SDK generation could be done but the actual product that you got in hand still needed a lot of work to be enterprise ready. The code was poor quality, wasn't customisable and there was no change management story. We're seeing a new wave of work in this space that's making api platform engineering much more accessible.

The API devex story starts with SDK creation and maintenance but there is a lot more to come!

Post reply on HN