Skip to content

Improve the experience for polymorphic model validation #13829

@pamedasa

Description

@pamedasa

Describe the bug

The annotations that we add for validations are not getting invoked for polymorphic input classes. They are getting invoked only for the non-polymorphic classes.
Data model validators are not being invoked for request input data which is of type polymorphic data. In general, all the validators are being fired up before passing to actual implementation of controller code.

To Reproduce

Steps to reproduce the behavior:

  1. Using this version of ASP.NET Core 2.2
  2. Run this code '....'
  3. With these arguments '....'
  4. See error

Expected behavior

in Asp.Net framework, irrespective on input data model (whether it is normal (or) polymorphic) all the validators gets invoked and thrown the exception in right format. After moving to asp.net core as well, validators should work as expected earlier.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.
Include the output of dotnet --info

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: DesignThis issue requires design work before implementating.area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing one

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions