Skip to content

Commit 4d099a8

Browse files
committed
update default configuration values
1 parent b0fd772 commit 4d099a8

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

FluentValidation.AutoValidation.Mvc/src/Configuration/AutoValidationMvcConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class AutoValidationMvcConfiguration
3030
/// Enables asynchronous automatic validation for parameters bound from <see cref="BindingSource.Form"/> binding sources (typically parameters decorated with the [FromForm] attribute).
3131
/// </summary>
3232
/// <see cref="FromFormAttribute"/>
33-
public bool EnableFormBindingSourceAutomaticValidation { get; set; } = false;
33+
public bool EnableFormBindingSourceAutomaticValidation { get; set; } = true;
3434

3535
/// <summary>
3636
/// Enables asynchronous automatic validation for parameters bound from <see cref="BindingSource.Query"/> binding sources (typically parameters decorated with the [FromQuery] attribute).
@@ -42,7 +42,7 @@ public class AutoValidationMvcConfiguration
4242
/// Enables asynchronous automatic validation for parameters bound from <see cref="BindingSource.Path"/> binding sources (typically parameters decorated with the [FromRoute] attribute).
4343
/// </summary>
4444
/// <see cref="FromRouteAttribute"/>
45-
public bool EnablePathBindingSourceAutomaticValidation { get; set; } = false;
45+
public bool EnablePathBindingSourceAutomaticValidation { get; set; } = true;
4646

4747
/// <summary>
4848
/// Enables asynchronous automatic validation for parameters bound from <see cref="BindingSource.Header"/> binding sources (typically parameters decorated with the [FromHeader] attribute).

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ app.MapPost("/", (SomeOtherModel someOtherModel) => $"Hello again {someOtherMode
8181
| DisableBuiltInModelValidation | `false` | Disables the built-in .NET model (data annotations) validation. |
8282
| ValidationStrategy | `ValidationStrategy.All` | Configures the validation strategy. Validation strategy `ValidationStrategy.All` enables asynchronous automatic validation on all controllers. Validation strategy `ValidationStrategy.Annotations` enables asynchronous automatic validation on controllers decorated (class or method) with a `[AutoValidationAttribute]` attribute. |
8383
| EnableBodyBindingSourceAutomaticValidation | `true` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Body` binding sources (typically parameters decorated with the `[FromBody]` attribute). |
84-
| EnableFormBindingSourceAutomaticValidation | `false` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Form` binding sources (typically parameters decorated with the `[FromForm]` attribute). |
84+
| EnableFormBindingSourceAutomaticValidation | `true` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Form` binding sources (typically parameters decorated with the `[FromForm]` attribute). |
8585
| EnableQueryBindingSourceAutomaticValidation | `true` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Query` binding sources (typically parameters decorated with the `[FromQuery]` attribute). |
86-
| EnablePathBindingSourceAutomaticValidation | `false` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Path` binding sources (typically parameters decorated with the `[FromRoute]` attribute). |
86+
| EnablePathBindingSourceAutomaticValidation | `true` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Path` binding sources (typically parameters decorated with the `[FromRoute]` attribute). |
8787
| EnableHeaderBindingSourceAutomaticValidation | `false` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Header` binding sources (typically parameters decorated with the `[FromHeader]` attribute). |
8888
| EnableCustomBindingSourceAutomaticValidation | `false` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Custom` binding sources. |
8989
| EnableNullBindingSourceAutomaticValidation | `false` | Enables asynchronous automatic validation for parameters not bound from any binding source (typically parameters without a declared or inferred binding source). |

UPGRADING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
### Upgrade from v1 to v2
66

7+
#### Configuration - MVC controllers
8+
The default values of the configuration options below have been changed:
9+
10+
- `EnableFormBindingSourceAutomaticValidation` from `false` to `true`
11+
- `EnablePathBindingSourceAutomaticValidation` from `false` to `true`
12+
713
#### Result factories - MVC controllers
814

915
```diff

0 commit comments

Comments
 (0)