Skip to content

Consider JsonValidationMetadataProviders affect only API Controllers #40408

@brunolins16

Description

@brunolins16

The new SystemTextJsonValidationMetadataProvider and NewtonsoftJsonValidationMetadataProviders were added in #39008, however, since their presence will impact how the DisplayName or ModelState errors messages are generated for both APIs and Views was decided to not add them as default.

However, they fix a very common issue for APIs, not much other scenarios, and we should consider an approach to those new providers only affect API Controllers. With that, they could be added as part of the default ModelProviders without affecting other parts of the application.

Related issue: #39010

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:3Work that is nice to havearea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions