Ivan
Ivan

Reputation: 115

Is it possible to create Swagger documentation in separate project for Asp Web Api?

Is it possible to generate a Swagger documentation for my ASP.Net Web API in a separate project?

I created an empty project where the Swagger documentation should go. In the API project the Swagger project is referenced, but didn't work. Than API project is load like an external assembly. The controllers was reachable, but documentation wasn't generated.

Then tried with the automatically generated XML documenatation, just to see if it will create anything, but there is no result.

After this try like to have multiple API in one Swagger documentation, Multiple API documentation in one Swagger file, wasn't work.

I also tried this:

On the Swagger official documentation I didn't find something that could help me with this. Neither did I find any information elsewhere if this is possible and how it needs to be done.

I use Swashbuckle 5.6.0 and ASP.Net Web API.

Upvotes: 4

Views: 3514

Answers (1)

Helder Sepulveda
Helder Sepulveda

Reputation: 17614

Yes, it is possible to generate Swagger documentation for a Web API in a separate project.

Here I have the code showing how I did it:
https://github.com/heldersepu/csharp-proj/tree/master/Swashbuckle.Sample

And here is how the swagger-ui looks like: http://swashbucklesample.azurewebsites.net/swagger/ui/index

To be honest Nothing special about that code, it worked on the first try for me ...
But I do have some experience with Swashbuckle


If you can provide a minimal project reproducing your issue, we can help you get to the bottom of it together.

Upvotes: 4

Related Questions