Does ServiceStack have the tooling to generate typed C# client from Swagger/Open API JSON file?
By this, I don’t mean adding swagger support to a ServiceStack service but generating a typed C# client from an external service (not made with ServiceStack) with a swagger file definition.
No, our Service Client story already adopts the most optimal strategy for ServiceStack APIs, code generating client proxies from a spec is deficient in comparison and there’s no justification why we’d invest any effort in it.
I managed to create a fully typed client supporting async with ServiceStack in less than 500 lines of code (497 to be exact).
That compares to the 6888 lines of code generated by a tool processing swagger file. On top of it, their generated client didn’t support authorization.
Basically, it took me less time to program the client using ServiceStack than it took me to figure out how to install the swagger tooling and wire in the authorization supports, etc.
The code is easier to understand and you understand at a glance what it’s doing.
Right as a DTO mathing the wire format. Also HttpStatusCode isn’t exhaustive where they could conceivably return a Status code not in the enum breaking your API, so I’d personally use an int instead.