Releases: FluentValidation/FluentValidation
10.2.2
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.2.2
- Add backwards compatibility overloads for the changes in 10.2.1 (#1752)
Changes in 10.2.1
- Optional internal type registration should work with
AddFluentValidation
as well as directly on the service collection (#1748)
Changes in 10.2.0
- Fix display name generation should be consistent between
RuleForEach
andRuleFor.ForEach
(#1231) - Allow
AddFluentValidation
to be called directly onIServiceCollection
(#1726) - Throw exception when calling
ValidateAndThrow
even ifPreValidate
prevents further validation (#1736) ValidationException
now includes rule severity (#1733)- Optionally support internal types when scanning assemblies for validators (#1742)
- Deprecate
RunDefaultMvcValidationAfterFluentValidationExecutes
in MVC configuration. UseDisableDataAnnotationsValidation
instead.
Changes in 10.1.0
- Allow default severity level to be set globally (#1715)
- Extend use of variance into the internal API to resolve invalid cast exceptions in some scenarios (#1711)
- Fix clientside metadata being incorrectly generated for cross-property LessThanOrEqual/GreaterThanOrEqual (#1721)
Changes in 10.0.4
- Resolved an issue where async conditions were run synchronously when applied to synchronous property validators
Changes in 10.0.3
- Fix ArgumentOutOfRangeException when condition returns false for RuleForEach containing multiple components (#1698)
Changes in 10.0.2
ErrorCode
is now exposed onIRuleComponent
Changes in 10.0.1
- Add
GetPropertyValue
toIValidationRule
to support #1688 - Context object is now strongly typed inside
IValidationRule<T>.ApplyCondition
/ApplyAsyncCondition
for users of the internal API
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
10.2.1
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.2.1
- Optional internal type registration should work with
AddFluentValidation
as well as directly on the service collection (#1748)
Changes in 10.2.0
- Fix display name generation should be consistent between
RuleForEach
andRuleFor.ForEach
(#1231) - Allow
AddFluentValidation
to be called directly onIServiceCollection
(#1726) - Throw exception when calling
ValidateAndThrow
even ifPreValidate
prevents further validation (#1736) ValidationException
now includes rule severity (#1733)- Optionally support internal types when scanning assemblies for validators (#1742)
- Deprecate
RunDefaultMvcValidationAfterFluentValidationExecutes
in MVC configuration. UseDisableDataAnnotationsValidation
instead.
Changes in 10.1.0
- Allow default severity level to be set globally (#1715)
- Extend use of variance into the internal API to resolve invalid cast exceptions in some scenarios (#1711)
- Fix clientside metadata being incorrectly generated for cross-property LessThanOrEqual/GreaterThanOrEqual (#1721)
Changes in 10.0.4
- Resolved an issue where async conditions were run synchronously when applied to synchronous property validators
Changes in 10.0.3
- Fix ArgumentOutOfRangeException when condition returns false for RuleForEach containing multiple components (#1698)
Changes in 10.0.2
ErrorCode
is now exposed onIRuleComponent
Changes in 10.0.1
- Add
GetPropertyValue
toIValidationRule
to support #1688 - Context object is now strongly typed inside
IValidationRule<T>.ApplyCondition
/ApplyAsyncCondition
for users of the internal API
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
10.2.0
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.2.0
- Fix display name generation should be consistent between
RuleForEach
andRuleFor.ForEach
(#1231) - Allow
AddFluentValidation
to be called directly onIServiceCollection
(#1726) - Throw exception when calling
ValidateAndThrow
even ifPreValidate
prevents further validation (#1736) ValidationException
now includes rule severity (#1733)- Optionally support internal types when scanning assemblies for validators (#1742)
- Deprecate
RunDefaultMvcValidationAfterFluentValidationExecutes
in MVC configuration. UseDisableDataAnnotationsValidation
instead.
Changes in 10.1.0
- Allow default severity level to be set globally (#1715)
- Extend use of variance into the internal API to resolve invalid cast exceptions in some scenarios (#1711)
- Fix clientside metadata being incorrectly generated for cross-property LessThanOrEqual/GreaterThanOrEqual (#1721)
Changes in 10.0.4
- Resolved an issue where async conditions were run synchronously when applied to synchronous property validators
Changes in 10.0.3
- Fix ArgumentOutOfRangeException when condition returns false for RuleForEach containing multiple components (#1698)
Changes in 10.0.2
ErrorCode
is now exposed onIRuleComponent
Changes in 10.0.1
- Add
GetPropertyValue
toIValidationRule
to support #1688 - Context object is now strongly typed inside
IValidationRule<T>.ApplyCondition
/ApplyAsyncCondition
for users of the internal API
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
10.1.0
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.1.0
- Allow default severity level to be set globally (#1715)
- Extend use of variance into the internal API to resolve invalid cast exceptions in some scenarios (#1711)
- Fix clientside metadata being incorrectly generated for cross-property LessThanOrEqual/GreaterThanOrEqual (#1721)
Changes in 10.0.4
- Resolved an issue where async conditions were run synchronously when applied to synchronous property validators
Changes in 10.0.3
- Fix ArgumentOutOfRangeException when condition returns false for RuleForEach containing multiple components (#1698)
Changes in 10.0.2
ErrorCode
is now exposed onIRuleComponent
Changes in 10.0.1
- Add
GetPropertyValue
toIValidationRule
to support #1688 - Context object is now strongly typed inside
IValidationRule<T>.ApplyCondition
/ApplyAsyncCondition
for users of the internal API
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
10.0.4
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.0.4
- Resolved an issue where async conditions were run synchronously when applied to synchronous property validators
Changes in 10.0.3
- Fix ArgumentOutOfRangeException when condition returns false for RuleForEach containing multiple components (#1698)
Changes in 10.0.2
ErrorCode
is now exposed onIRuleComponent
Changes in 10.0.1
- Add
GetPropertyValue
toIValidationRule
to support #1688 - Context object is now strongly typed inside
IValidationRule<T>.ApplyCondition
/ApplyAsyncCondition
for users of the internal API
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
10.0.3
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.0.3
- Fix ArgumentOutOfRangeException when condition returns false for RuleForEach containing multiple components (#1698)
Changes in 10.0.2
ErrorCode
is now exposed onIRuleComponent
Changes in 10.0.1
- Add
GetPropertyValue
toIValidationRule
to support #1688 - Context object is now strongly typed inside
IValidationRule<T>.ApplyCondition
/ApplyAsyncCondition
for users of the internal API
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
10.0.2
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.0.2
ErrorCode
is now exposed onIRuleComponent
Changes in 10.0.1
- Add
GetPropertyValue
toIValidationRule
to support #1688 - Context object is now strongly typed inside
IValidationRule<T>.ApplyCondition
/ApplyAsyncCondition
for users of the internal API
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
10.0.1
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.0.1
- Add
GetPropertyValue
toIValidationRule
to support #1688 - Context object is now strongly typed inside
IValidationRule<T>.ApplyCondition
/ApplyAsyncCondition
for users of the internal API
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
10.0.0
Release notes
Please read the upgrade guide if you are moving from 9.x to 10.x
Changes in 10.0.0
- Various performance improvements throughout the library
- Collection rules now only iterate the collection once
- Property validator classes are now generic
- Deprecated non-generic
PropertyValidator
. - Changed type of
ValidationResult.Errors
fromIList<ValidationFailure>
toList<ValidationFailure>
- The internal API now uses generics.
- Various property validator options have been seperated into
RuleComponents
. - Various parts of the internal API are now internal (PropertyRule, CollectionPropertyRule etc).
ValidatorDescriptor
now returns rule components in various places, wherePropertyValidators
were previously returned- Default service lifetime in ASP.NET projects is now
Scoped
rather thanTransient
. - Combined
IActionContextValidatorInterceptor
andIValidatorInterceptor
. - Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
- Removed deprecated
IStringSource
and its inheritors. - Removed deprecated
FormattedMessageArguments
fromValidationFailure
. - Removed other deprecated code.
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration
9.5.4
Release notes
Please read the upgrade guide if you are moving from 8.x to 9.x
Changes in 9.5.4
- Fix Serbian translation of error messages (#1683)
- Add Vietnamese translations of error messages (#1677)
Changes in 9.5.3
- Fix Swedish translation for CreditCardValidator (#1664)
Changes in 9.5.2
- Fix Dutch translation of some errors (#1653)
- Fix string equality comparison in WithCustomState extension (#1658)
Changes in 9.5.1
- Fix incorrect wording in deprecation message for Transform (#1613)
- Fix ScalePrecision validator being available in intellisense for non-decimal properties.
- Expose additional overload of
Transform
that receives the root object in the transformer.
Changes in 9.5.0
- Introduce new syntax for applying transformations and deprecate the old syntax (#1613)
Changes in 9.4.0
- ChildRules now work as expected when inside a ruleset (#1597)
- Added ImplicitlyValidateRootCollectionElements option to MVC integration (#1585)
Changes in 9.3.0
- Support for .NET 5 and ASP.NET Core 5
- Improvements to LanguageManager's lazy loading of resources.
- Deprecate IStringSource and its implementors. Use delegates instead.
- CustomizeValidatorAttribute now works in Razor pages (netcore 3.1 and net 5.0 only) (#1541)
- RuleSetForClientSideMessagesAttribute now works in Razor pages (netcore 3.1 and net 5.0 only) (#1544)
- Fixes to Spanish translations.
Changes in 9.2.2
- Fix one of the inheritance validator overloads not working correctly (#1528)
Changes 9.2.1
- Add non-generic extensibility point to inheritance validator
- Updates to Persian translations (#1513)
- Added Bengali translations (#1517)
Changes in 9.2.0
- Add inheritance validator (#1237) - see https://docs.fluentvalidation.net/en/latest/inheritance.html
- Various performance improvements
Changes in 9.1.3
- Fix an issue with IncludeRulesNotInRuleSet not working correctly (#1493)
Changes in 9.1.2
- Make the ValidationContext.ThrowOnFailures getter public.
Changes in 9.1.1
- Update incorrect wording in
CascadeMode.StopOnFirstFailure
deprecation warning.
Changes in 9.1.0
- Add new Validate extension methods that allow options to be configured using a strategy (#1467)
- Introduce CascadeMode.Stop and deprecate CascadeMode.StopOnFirstFailure to resolve confusion/abiguity about setting the cascade mode at validator-level (#1437)
- RaiseValidationException can be overridden to customize the exception throwing process (#1162)
- Make ruleset separator character splitting consistent (#1424)
- Transform now works with RuleForEach (#1450)
- Introduce constants for rulesets (#1435)
- Resolve issue when attempting to use asynchronous conditions in a synchornous validaiton run (#1438)
- Added asynchronous versions of the TestHelper methods (#1423)
Example of using the new validation strategy:
// Validate specific rulesets
validator.Validate(instance, opt => {
opt.IncludeRuleSets("MyRuleSet", "SomeOtherRuleSet");
// Can also force rules not in a ruleset to be run
opt.IncludeRulesNotInRuleSet();
});
// Validate specific properties
validator.Validate(instance, opt => {
opt.IncludeProperties("Forename", "Surname");
// or
opt.IncludeProperties(x => x.Surname, x.Forename);
});
// Throw exceptions on failure
validator.Validate(instance, opt => {
opt.ThrowOnFailures();
});
// Combine various options
validator.Validate(instance, opt => {
opt.IncludeRuleSets("MyRuleSet", "SomeOtherRuleSet").IncludeRulesNotInRuleSet();
opt.ThrowOnFailures();
});
Downloads
Binaries can be downloaded from nuget:
- FluentValidation - Main package
- FluentValidation.AspNetCore - ASP.NET Core integration