Skip to content

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

@erwinkramer

Description

@erwinkramer

Is there an existing issue for this?

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThis issue tracks updating documentationarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-validationIssues related to model validation in minimal and controller-based APIs

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions