-1

There is swagger and there is nswag.

NSwag does some client generation.

Is it possible to generate client and display it as a link on Swagger UI for the consumers to download and use it?

DarthVader
  • 52,984
  • 76
  • 209
  • 300
  • You can simply add a download link to the `info.description` section of your API definition. Or do you mean something else? – Helen Nov 22 '18 at 22:08

1 Answers1

2

Almost certainly not out the box. But then... you don't necessarily know what technology your client will choose. NSwag will generate a number of different types of clients in just a few minutes with little more effort than pointing it at the JSON Swagger definition (which Swagger/Swashbuckle automatically produces for your API), and is free to download; why not just let them do it?

You could speculatively generate a C# client for them and host it on your API server and serve it as say a zip file, but I don't really see the point, plus you'd have to make various customisation decisions for them, that they might prefer to make for themselves (namespace, HttpClient injection, partial class usage, etc).

sellotape
  • 8,034
  • 2
  • 26
  • 30