dotnet / dotnet/AspNetCore.Docs

[.NET 10] Emphasize scope of `AddValidation()` on built-in validation support for minimal APIs

Open
#35,940 1 comment 1 reaction 0 assignees View on GitHub
:watch: Not Triaged
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

_No response_

### Describe the solution you'd like

It might be useful to emphasize at https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-10.0?view=aspnetcore-9.0#enable-built-in-validation-support-for-minimal-apis that `UnmappedMemberHandling` by default is set to `Skip`, even when adding `builder.Services.AddValidation();`. This might seem strange when you assume that adding the validation service will just validate the whole incoming JSON with the object type.

To take things further, it might even make more sense to call it `AddAnnotationValidation` instead of `AddValidation` because it's really scoped to a small part, and it isn't responsible for all the validation, like unmatched (query) parameters, or enums.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.