Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swagger-Web Api Documentation(Bootstrapper is missing in Swashbuckle)

Tags:

swagger

I am trying to use swagger for my web api documentation, For that i have installed Swashbuckle from nuget packages but i am unable to get the Bootstrapper package in the swaggerconfig.cs class. so is there any other alternative to get the Bootstrapper package in the swaggerconfig.cs class. Please help me out. Thank you.

like image 406
Meena Avatar asked Apr 03 '15 10:04

Meena


People also ask

How do I install Swagger to Web API net core?

Add and configure Swagger middlewareLaunch the app and navigate to https://localhost:<port>/swagger/v1/swagger.json . The generated document describing the endpoints appears as shown in OpenAPI specification (openapi. json). The Swagger UI can be found at https://localhost:<port>/swagger .

Which is embedded version of swagger UI tool?

Swashbuckle. In addition to its Swagger 2.0 and OpenAPI 3.0 generator, Swashbuckle also provides an embedded version of the awesome swagger-ui that's powered by the generated Swagger JSON. This means you can complement your API with living documentation that's always in sync with the latest code.

How do you customize Swagger?

By default, Swagger UI uses BaseLayout , which is built into the application. You can specify a different layout to be used by passing the layout's name as the layout parameter to Swagger UI. Be sure to provide your custom layout as a component to Swagger UI.


2 Answers

If your service is hosted in IIS, you can start exposing Swagger docs and a corresponding swagger-ui by simply installing the following Nuget package:

Install-Package Swashbuckle

This will add a reference to Swashbuckle.Core and also install a bootstrapper automatically

https://github.com/domaindrivendev/Swashbuckle

Thanks.

like image 136
Meena Avatar answered Oct 07 '22 02:10

Meena


If Swashbuckle.Bootstrapper.Init(config); is missing. I used an older version of Swashbuckle 4.1.0 it worked for me.

enter image description here

like image 28
Rao Adnan Avatar answered Oct 07 '22 03:10

Rao Adnan