Hacker News new | ask | show | jobs
by benbristow 1389 days ago
I feel a bit spammy as I just commented on a comment a bit higher with the same thing, but NSwag will do the trick for you.

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.

1 comments

Thanks - NSwag had already been on my list to look at next week. The difference I see is that NSwag GitHub page is many screen heights long and it looks like I'm going to have to spend a bunch of time figuring it out. EasySDK was just click to upload a swagger file and I have a great looking TypeScript SDK, done.
Following up on this, the NSwag docs are definitely not as user friendly as the EasySdk site, but I was able to install and run the windows GUI app for NSwag and compare handling of a moderately large swagger file. EasySDK generated a TypeScript file that was 1/4 the size, far more readable, and from what I could tell as capable as the NSwag generated TypeScript file. That said, NSwag can generate C# files which EasySdk can not do (yet). Kiota (mentioned elsewhere in the comments) was unable to parse the swagger file.