Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • ApiExplorer for WebAPI controllers in external assembly
  • https://github.com/Microsoft/aspnet-api-versioning/issues/271

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.

like image 223
Ivan Avatar asked Nov 01 '25 16:11

Ivan


1 Answers

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.

like image 132
Helder Sepulveda Avatar answered Nov 04 '25 20:11

Helder Sepulveda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!