最佳答案
对此的解决方案是在 Startup.cs
中使用 ConfigureApiBehaviorOptions
SuppressMapClientErrors
,如下所示:
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers().ConfigureApiBehaviorOptions(x => { x.SuppressMapClientErrors = true; });
...
}
关于c# - Swagger UI 隐藏 AspNetCore.Mvc.ProblemDetails 架构 .net 5 和 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69541795/