Live data from Hacker News

Show HN: An opinionated and statically-typed TypeScript SDK generator

easysdk.xyz

21–30 of 47 posts

Re: Show HN: An opinionated and statically-typed TypeScript SDK generator

#21

Congrats Sagar and team - excited that someone is working on this! OpenAPI generator and swagger codegen has almost always produced unreadable and unusable SDKs for me, especially when my schema contains any model composition or polymorphism with allOf/anyOf/oneOf. Have you guys written this entirely from scratch or done your own mustache templating on top of openapi-generator?

yeah i was always annoyed how machine like the stubs that it generated are. I did here that they invested on making the go SDK more idiomatic. We've been exploring using templating or taking this approach of writing the generators from scratch in the native language.

Re: Show HN: An opinionated and statically-typed TypeScript SDK generator

#23
Reminds me of how visual studio used to produce .net client code in vb or c# when you gave it a wsdl URL. You could do the same thing with Delphi. It had a command line program to generate a client interface. And a Ruby gem could just generate calls on the fly with method_missing. Turns out that having a web service definition language and concrete types to generate it automatically is a really useful thing. A thing that we somehow seem to have lost on the road.

Re: Show HN: An opinionated and statically-typed TypeScript SDK generator

#26

Reminds me of how visual studio used to produce .net client code in vb or c# when you gave it a wsdl URL. You could do the same thing with Delphi. It had a command line program to generate a client interface. And a Ruby gem could just generate calls on the fly with method_missing. Turns out that having a web service definition language and concrete types to generate it automatically is a really useful thing. A thing…

Yeah totally agree - unfortunate that OpenAPI so much flexibility that there are multiple ways to define the same operations. For api users having the concrete types just means faster integration, no ambiguity on what is/is not supported.

Re: Show HN: An opinionated and statically-typed TypeScript SDK generator

#29
post #13

Congrats on launching! For anyone looking for more (open-source) alternatives, here's one I just discovered today: https://microsoft.github.io/kiota/

I've had success with NSwag for generating both TypeScript and C# clients. Highly customisable - maybe too customisable with the config being quite complex - there's CLI & GUI tools to generate configs though. https://github.com/RicoSuter/NSwag We use the C# client generator in our public sector project and package the results up within Nuget, works a treat.

Yeah Nswag is great, but pretty specific to the .NET ecosystem if i understand correctly ? Ideally we'd like this to become a universal generator where any dev/team/company publishing an API gets typed and idiomatic clients, including the long tail of languages.

Re: Show HN: An opinionated and statically-typed TypeScript SDK generator

#30

Wow, what a coincidence :D We are about to launch something similar: https://samen.io

very cool ! So Samen is a way to manage types across frontend and backends?

Thanks! Yes, it will do that automatically by generating an SDK for your client (which will include all types you expose on your backend).
Post reply on HN