Swagger for Azure Service Fabric Stateless Web API application

倾然丶 夕夏残阳落幕 提交于 2020-01-04 01:51:32

问题


I am developing Web API service and hosting on Azure Service Fabric as Micro Service. I need to implement Swagger for the API definition and I could see SwaggerConfig.Register() method not calling while application is starting. So I could not access http://faricurl:8000/swagger.

So can you please point out how to integrate Swagger definition for Web API application.

Many Thanks, Thirumalai M


回答1:


As suggested in my comment install the core Swashbuckle NuGet package

install-package Swashbuckle.Core

Then in the Startup.cs of your WebApi project add

 config.EnableSwagger(c => c.SingleApiVersion("v1", "A title for your API"))
        .EnableSwaggerUi();


来源:https://stackoverflow.com/questions/40088573/swagger-for-azure-service-fabric-stateless-web-api-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!