-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-model-binding
Milestone
Description
Hi,
I followed your example on disabling validation (see: https://docs.microsoft.com/en-us/aspnet/core/mvc/models/validation?view=aspnetcore-5.0) and noticed some strange side-behavior, e.g. model validation on classes was indeed disabled, but validation on action (method) parameters (f.e. passed by query) resulted in a bad request (HTTP 400)
In short: a POST with a model in the body functioned as documented, but a GET with query parameters didn't.
the example code tested:
public class NullObjectModelValidator : IObjectModelValidator
{
public void Validate(ActionContext actionContext,
ValidationStateDictionary validationState, string prefix, object model)
{
}
}... and ...
services.AddSingleton<IObjectModelValidator, NullObjectModelValidator>();
Is this by design or indeed a bug?
TIA
Bert
MaceWindu
Metadata
Metadata
Assignees
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-model-binding