Problem Details Demo

Web API endpoints

Use Swagger UI to explore various Problem detail responses from Web API endpoints

Try
More information
MVC HTML endpoints

Confirm that exceptions / non-success status codes from HTML endpoints are NOT sent as Problem details responses

Try
Serving both HTML and JSON responses?

If yes, you will need to configure different exception handling middleware for each response type.

    
    app.UseWhen(IsUIRequest, app2 =>
    {
        app2.UseExceptionHandler("/ui/home/error");
        app2.UseStatusCodePages();
    });
    app.UseWhen(IsNonUIRequest, app2 =>
    {
        app2.UseProblemDetails();
    });