Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Application.WebAPI/Application.WebAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.4" />
<ProjectReference Include="..\Application\Application.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Application\Application.csproj" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.3" />
</ItemGroup>

</Project>
14 changes: 6 additions & 8 deletions src/Application.WebAPI/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;

namespace Ideator.API
{
Expand All @@ -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.
Expand All @@ -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();
Expand All @@ -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();
});
}
}
}
Loading