diff --git a/Endpoint/Program.cs b/Endpoint/Program.cs index b643ee8..cd07ac5 100644 --- a/Endpoint/Program.cs +++ b/Endpoint/Program.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpOverrides; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; @@ -58,7 +59,10 @@ public class Program builder.Host.AddCustomSerilog(); AddDatabase(builder.Services, builder.Configuration, healthCheckBuilder); - builder.Services.AddControllers(); + builder.Services.AddControllers(options => + { + options.Filters.Add(new ProducesResponseTypeAttribute(StatusCodes.Status500InternalServerError)); + }); builder.Services.AddSingleton(); builder.Services.AddSingleton();