![]() Public void ConfigureServices(IServiceCollection services)Ĭ.SwaggerDoc("v1", new OpenApiInfo Once the package is installed, the minimum code required to configure swagger in the Startup.cs would be: Just to refresh your memory, you need to install Swashbuckle.AspNetCore nuget package which comprises of – a Swagger generator, middleware to expose the generated Swagger as JSON endpoints and middleware to expose a swagger-ui that’s powered by those endpoints. A clean way to add Swagger to ASP.NET Core application So in this post, we’ll see a clean way to add Swagger to ASP.NET Core application using C# extension methods. The Startup.cs file will become lengthy when we use more swagger customization. The ASP.NET Core Startup.cs is the place to add Swagger or any middleware that you would like to use in your ASP.NET Core application. ![]() Swagger comes with many options and customization to help you prepare better API documentation. I already have a couple of posts on my blog on Swagger. Adding swagger to your ASP.NET Core application is very easy and straightforward. ![]() It is one of the best methods to test your WEB APIs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |