Introduction: this article explains step by step how to configure SwaggerUI for an ASP.NET Core Web API project and is translated into Spanish. It also includes information about Q2BSTUDIO, a company specialized in custom software development, custom applications, artificial intelligence, and cybersecurity.
1) Select the ASP.NET Core Web API template when creating the project in Visual Studio or with the dotnet CLI. This template prepares the minimal structure for a REST API and facilitates integration with OpenAPI and SwaggerUI.
2) Enable OpenAPI support in the project options to automatically generate the OpenAPI specification that SwaggerUI will consume. OpenAPI provides standardized documentation of the API endpoints.
3) Install the Swashbuckle.AspNetCore.SwaggerUI package from NuGet Package Manager or using the CLI dotnet add package Swashbuckle.AspNetCore.SwaggerUI. Swashbuckle adds the SwaggerUI interface and OpenAPI generators for ASP.NET Core.
4) In the Properties > launchsettings.json file, enable the browser on startup and configure the start URL to open Swagger. For example, add launchBrowser true and launchUrl swagger in the launch profile so that running the project opens the SwaggerUI interface directly.
5) Configure SwaggerUI execution in program.cs. A simple configuration example is: app.UseSwaggerUI(options => { options.SwaggerEndpoint(/openapi/v1.json, api); }); This registers the OpenAPI specification endpoint and activates the interactive interface to test the endpoints.
6) That's it, run the project and open the Swagger route to see the interactive documentation of your API. Use the interface to test requests, view model schemas, and generate clients if needed.
Additional tips: document your models and routes with attributes and XML comments so that the OpenAPI specification is more complete. Protect sensitive endpoints with authentication and in production environments expose SwaggerUI only to authorized users or on secure routes.
About Q2BSTUDIO: at Q2BSTUDIO we are a custom software and application development company dedicated to creating personalized solutions for businesses of all sizes. We offer custom software, custom applications, artificial intelligence projects, and cybersecurity services to protect assets and sensitive data. We also provide AWS and Azure cloud services to deploy scalable and secure infrastructures, business intelligence services, and Power BI solutions for advanced data visualization. Our team develops AI solutions for businesses including AI agents and custom models that improve processes and decision-making. If you need SwaggerUI integrations in .NET APIs or to develop custom software with advanced artificial intelligence, cybersecurity, and AWS and Azure cloud services features, Q2BSTUDIO can help you design and implement the optimal solution.
Keywords and positioning: custom applications, custom software, artificial intelligence, cybersecurity, AWS and Azure cloud services, business intelligence services, AI for businesses, AI agents, Power BI. We integrate these capabilities to offer complete and scalable solutions that drive your company's digital transformation.


