Swashbuckle.webapi: Unable to Generate different Swagger URLs for individual apis across different controllers

Created on 1 Apr 2016  路  4Comments  路  Source: domaindrivendev/Swashbuckle.WebApi

Hello,

I am having an ASP.NET Web API MicroServices project wherein I have a root project and other projects in my solution. All the projects in the solution contains multiple controllers and each controller contains several apis.

I would like to know whether we can generate separate swagger URL for the individual apis. This is because I need to import them to Azure API Gateway one by one rather than importing them as a whole. Below is the structure of my project. Currently the Swashbuckle library generates a single Swagger URL for all the apis in the project.

Solution
Project A
Controller 1
API - 1 GET
API - 2 POST
API - 3 GET

Project B
Controller 2
API - 1 GET
API - 2 POST
API - 3 GET

In this case I want the individual swagger DOC url of each api so that I can add them to the API Gateway. I want to manage each individual api in the gateway portal rather than adding them all together. Is there a way I can achieve this.

Thanks a lot in advance.

Most helpful comment

Hello everyone, I cannot believe there is no way to create an individual Swagger UI per each version.

I am waiting so much time on it. How did you guys tackle this ?

@maheshmohandas @Marusyk

All 4 comments

Currently, you can only create separate documents for different versions of an API (see https://github.com/domaindrivendev/Swashbuckle#describing-multiple-api-versions).

Arbitrary grouping is not currently supported but is definitely something I'll be looking at for the next major version.

any news about that?

There is now a separate project specifically for ASP.NET Core and this supports arbitrary grouping of API actions into multiple Swagger documents:

https://github.com/domaindrivendev/Swashbuckle.AspNetCore#generate-multiple-swagger-documents

Of course this is only available if you've moved your application to ASP.NET Core. I don't plan on implementing it in this, WebAPI-specific, version but you do have some options. Check out #764 for some ideas

Hello everyone, I cannot believe there is no way to create an individual Swagger UI per each version.

I am waiting so much time on it. How did you guys tackle this ?

@maheshmohandas @Marusyk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joseph-ortiz picture joseph-ortiz  路  4Comments

johnpmcclung picture johnpmcclung  路  3Comments

djem3000 picture djem3000  路  5Comments

Misiu picture Misiu  路  3Comments

whippet-rider picture whippet-rider  路  5Comments