-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-validationIssues related to model validation in minimal and controller-based APIsIssues related to model validation in minimal and controller-based APIs
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
After adding validation to ASP.NET Core, Minimal API endpoints that used to return 400 on parsing errors, now return 400 and continue execution of the endpoint handler.
IMO this is a symptom of a more generic issue - when using AddEndpointFilterFactory and returning the next delegate as-is, the same problem occurs.
Expected Behavior
Return 400 and stop.
Steps To Reproduce
AddValidation issue:
builder.Services.AddValidation();
...
app.MapGet("/x/{id}", (Guid id) => 1);AddEndpointFilterFactory issue:
app.MapGet("/x/{id}", (Guid id) => 1).AddEndpointFilterFactory((_, next) => next);Both produce 400 + the response body 1 when the GUID is invalid.
Exceptions (if any)
No response
.NET Version
10.0.100
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-validationIssues related to model validation in minimal and controller-based APIsIssues related to model validation in minimal and controller-based APIs