Search code examples
swaggerswagger-uiswashbuckleazure-api-apps

Is there any reason using only swagger/docs/v1 for generating swagger metadata in the form JSON


I am currently working on Azure API App services, In that I have little bit confusion for generating swagger metadata using swashbuckler. for that I read the below documentation in that they are mentioning to see your metadata just add swagger/docs/v1 at the end your API url.

https://learn.microsoft.com/en-us/azure/app-service-api/app-service-api-dotnet-get-started

I am also did same thing and I am able to see my metadata generation In the form JSON. but when I added swagger/help/v1 or swagger/help/v2 at the end of my API url, I am not getting any metadata in the form JSON.

Is there any reason using only swagger/docs/v1 for generating swagger metadata in the form JSON or others also allowed like swagger/help/v1 etc.


Solution

  • Swashbuckle's default path is /swagger/docs/v1, and the Swashbuckle docs show how to change that path.

    httpConfiguration
        .EnableSwagger("docs/help/{apiVersion}", c => c.SingleApiVersion("v1", "A title for your API"))
        .EnableSwaggerUi("sandbox/{*assetPath}");
    

    In this case the URL to swagger json will be docs/help/v1 and the url to the swagger-ui will be sandbox/index.