Show HN: An opinionated and statically-typed TypeScript SDK generator
11–20 of 47 posts
Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#12Congrats on the launch! I think it might be interesting to provide some examples without the need to upload a schema, since I assume most people playing with it won't have one ready right off the bat.
You can go to the Swagger Editor [1], download the default Pet Store schema as a JSON file, and upload it here to see an example in action. [1]: https://editor.swagger.io/ Edit: Apparently their URLs are public, so here is the Pet Store schema I uploaded https://easysdk.xyz/sdk/openapi.json-a09be341882b7aa7b87eb40...
It looks like all the data interfaces add this, which will (a) happily swallow typos, and (b) give you no warning that you might be pushing extra (i.e. private) data to the remote.
I understand that some people like the flexibility it provides, but it would be nice for that to be an option. There's no way I'd use the generated types with that, and the tool has a lot less value if I still have to go in and modify its output by hand.
Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#13For anyone looking for more (open-source) alternatives, here's one I just discovered today: https://microsoft.github.io/kiota/
Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#14Have you guys written this entirely from scratch or done your own mustache templating on top of openapi-generator?
Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#15Congrats 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?
Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#16Earlier quoted context omitted.
You can go to the Swagger Editor [1], download the default Pet Store schema as a JSON file, and upload it here to see an example in action. [1]: https://editor.swagger.io/ Edit: Apparently their URLs are public, so here is the Pet Store schema I uploaded https://easysdk.xyz/sdk/openapi.json-a09be341882b7aa7b87eb40...
`[k: string]: unknown;` It looks like all the data interfaces add this, which will (a) happily swallow typos, and (b) give you no warning that you might be pushing extra (i.e. private) data to the remote. I understand that some people like the flexibility it provides, but it would be nice for that to be an option. There's no way I'd use the generated types with that, and the tool has a lot less value if I still have…
It comes because we’re a bit pragmatic: if a user doesn’t specify their full data structure in their OpenAPI specification, and we can’t generate a strict type, we allow an arbitrary structure to reach the backend. In our experience the hard bit isn’t really writing the SDK, it’s making and maintaining a good OpenAPI spec (hence part of the commercial product we’re moving towards is the ability to generate a strict OpenAPI specification directly from handler code / traffic analysis in a backend server). Your concern is totally valid, and this is something we will make configurable.
Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#17Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#18Would you mind to share, how the animation was made? I would imagine sth. like blender + after effects + lottie..
Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#19Congrats on launching! For anyone looking for more (open-source) alternatives, here's one I just discovered today: https://microsoft.github.io/kiota/
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.
Re: Show HN: An opinionated and statically-typed TypeScript SDK generator
#20Nice! Any plans for generating C# sdk's?
https://github.com/RicoSuter/NSwag
Works a treat and is open-source, integrates nicely with ASP WebAPI projects. Can even generate TypeScript clients with a choice of HTTP library (axios/fetch etc.) or even an Angular based client.