Skip to content

Releases: FluentValidation/FluentValidation

10.2.2

01 Jun 11:17
Compare
Choose a tag to compare

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 and RuleFor.ForEach (#1231)
  • Allow AddFluentValidation to be called directly on IServiceCollection (#1726)
  • Throw exception when calling ValidateAndThrow even if PreValidate 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. Use DisableDataAnnotationsValidation 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 on IRuleComponent

Changes in 10.0.1

  • Add GetPropertyValue to IValidationRule 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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

10.2.1

30 May 10:36
Compare
Choose a tag to compare

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 and RuleFor.ForEach (#1231)
  • Allow AddFluentValidation to be called directly on IServiceCollection (#1726)
  • Throw exception when calling ValidateAndThrow even if PreValidate 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. Use DisableDataAnnotationsValidation 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 on IRuleComponent

Changes in 10.0.1

  • Add GetPropertyValue to IValidationRule 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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

10.2.0

28 May 12:44
Compare
Choose a tag to compare

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 and RuleFor.ForEach (#1231)
  • Allow AddFluentValidation to be called directly on IServiceCollection (#1726)
  • Throw exception when calling ValidateAndThrow even if PreValidate 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. Use DisableDataAnnotationsValidation 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 on IRuleComponent

Changes in 10.0.1

  • Add GetPropertyValue to IValidationRule 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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

10.1.0

28 Apr 07:32
Compare
Choose a tag to compare

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 on IRuleComponent

Changes in 10.0.1

  • Add GetPropertyValue to IValidationRule 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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

10.0.4

17 Apr 12:11
Compare
Choose a tag to compare

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 on IRuleComponent

Changes in 10.0.1

  • Add GetPropertyValue to IValidationRule 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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

10.0.3

15 Apr 13:22
Compare
Choose a tag to compare

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 on IRuleComponent

Changes in 10.0.1

  • Add GetPropertyValue to IValidationRule 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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

10.0.2

09 Apr 09:49
Compare
Choose a tag to compare

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 on IRuleComponent

Changes in 10.0.1

  • Add GetPropertyValue to IValidationRule 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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

10.0.1

08 Apr 17:04
Compare
Choose a tag to compare

Release notes

Please read the upgrade guide if you are moving from 9.x to 10.x

Changes in 10.0.1

  • Add GetPropertyValue to IValidationRule 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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

10.0.0

06 Apr 13:30
Compare
Choose a tag to compare

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 from IList<ValidationFailure> to List<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, where PropertyValidators were previously returned
  • Default service lifetime in ASP.NET projects is now Scoped rather than Transient.
  • Combined IActionContextValidatorInterceptor and IValidatorInterceptor.
  • Changes to the ASP.NET Client Validator Adaptor interfaces. These now receive the rule component.
  • Removed deprecated IStringSource and its inheritors.
  • Removed deprecated FormattedMessageArguments from ValidationFailure.
  • Removed other deprecated code.

Downloads

Binaries can be downloaded from nuget:

9.5.4

05 Apr 14:25
Compare
Choose a tag to compare

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

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: