Skip to content

Results.ValidationProblem not including errors in response #41634

Closed
@forrestab

Description

@forrestab

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Errors are not available in the response when returning with Results.ValidationProblem.

app.MapPost("/test", () =>
{
    return Results.ValidationProblem(new Dictionary<string, string[]> {
        { "testError", new string[] { "message" } }
    });
});

Hitting the endpoint above I dont see the errors provided in the response:

{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400
}

Expected Behavior

Hitting the same endpoint above with 7.0.100-preview.3.22179.4 I correctly see the errors provided in the response:

{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "errors": {
        "testError": [
            "message"
        ]
    }
}

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

7.0.100-preview.4.22252.9

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcbugThis issue describes a behavior which is not expected - a bug.feature-minimal-actionsController-like actions for endpoint routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions