diff --git a/src/Application.WebAPI/Application.WebAPI.csproj b/src/Application.WebAPI/Application.WebAPI.csproj index eb6cf4c..1e5c774 100644 --- a/src/Application.WebAPI/Application.WebAPI.csproj +++ b/src/Application.WebAPI/Application.WebAPI.csproj @@ -6,11 +6,11 @@ - + - + diff --git a/src/Application.WebAPI/Startup.cs b/src/Application.WebAPI/Startup.cs index d221d87..78b0898 100644 --- a/src/Application.WebAPI/Startup.cs +++ b/src/Application.WebAPI/Startup.cs @@ -4,7 +4,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.OpenApi.Models; namespace Ideator.API { @@ -22,10 +21,7 @@ public void ConfigureServices(IServiceCollection services) { services.ConfigureDomainServices(); services.AddControllers(); - services.AddSwaggerGen(c => - { - c.SwaggerDoc("v1", new OpenApiInfo {Title = "Application.WebAPI", Version = "v1"}); - }); + services.AddOpenApi(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -34,8 +30,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); - app.UseSwagger(); - app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Application.WebAPI v1")); } app.UseHttpsRedirection(); @@ -44,7 +38,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseAuthorization(); - app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + endpoints.MapOpenApi(); + }); } } } \ No newline at end of file