Skip to content

Releases: FluentValidation/FluentValidation

9.1.2

12 Aug 16:10
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.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:

9.1.1

08 Aug 17:04
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.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:

9.1.0

08 Aug 11:21
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.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:

9.0.0

06 Jul 14:53
Compare
Choose a tag to compare

Release notes

FluentValidation 9 is a major release and includes several breaking changes. Please read the upgrade guide for full details

Changes in 9.0.0

  • ASP.NET core auto-validation can now be completely disabled while preserving clientside integration
  • Types can now be filtered/skipped when auto-registering with the container
  • Service lifetime is now configurable when auto-registering with the container

Changes in 9.0-preview5

  • Remove IValidator.Validate(object) overload to improve typesafety (use a context if you need to preserve this behaviour)
  • Replace non-generic ValidationContext class with IValidationContext interface
  • ChildValidatorAdaptor and IncludeRule now require a generic type parameter indicating the root type being validated
  • Expression accessors for comparison properties are now cached where possible
  • {ComparisonProperty} placeholder now passes through the same logic as the {PropertyName} placeholder for consistency

Changes in 9.0-preview4

  • {CollectionIndex} placeholder can now be accessed in child validators
  • Additional ValidationException constructor that allows customising the default message.
  • ScalePrecisionValidator algorithm now more consistent with SQL server (#1356)
  • Add Icelandic translations of default messages (#1362)
  • Additional When predicate overload that takes a ValidationContext
  • Fixes to range clientside validators when using datetimes (#1371)
  • Drop unsupported .NET Core versions from platform list

Changes in 9.0-preview3

  • ASP.NET Core validator provider is now public
  • Ensure ASP.NET Core providers aren't registered twice
  • SoureLink integration
  • Additional overload of SetValidator that receives property value in callback
  • PropertyRule.ApplySharedCondition is now public
  • Remove lowercase placeholders from ScalePrecisionValidator

Changes in 9.0-preview2

  • Transform can now be used to transform a property value to another type prior to validation occurring
  • Added WithMessageArgument to test helper extensions
  • Added Slovenian translations of default error messages.
  • Fixes/better handling of the non-generic overloads of AbstractValidator.Validate
  • Removed the deprecated FluentValidation.Internal.Comparer
  • TrackingCollection has been marked as internal
  • Updated to latest version of Microsoft.NETFramework.ReferenceAssemblies for building net4x targets on non-windows platforms.

Changes in 9.0-preview1

  • Removed support for netstandard1.1, netstandard1.6, net45 (Supported platforms are now netstandard2, net461, netcoreapp2.1, netcoreapp3.0, netcoreapp3.1)
  • Removed WithLocalizedMessage (WithMessage that takes a callback is the replacement)
  • Removed ResourceName from ValidationFailure
  • Removed ResourceName and ResourceType from IStringSource.
  • Removed SetCollectionValidator which was deprecated in 8.0
  • Additional overload of OnAnyFailure that can receive a collection of validation failures
  • Remove DisplayAttribute integration and reference to DataAnnotations.
  • Default email validation mode now uses the same logic as ASP.NET Core. Previous regex behaviour is opt-in.
  • ComparisonProperty placeholder is now formatted like PropertyName.
  • TestHelper syntax improvements
  • Equal/NotEqual now perform ordinal comparisons on string properties by default
  • Severity can be set with a callback
  • PropertyValidator.ShouldValidateAsync reanamed to ShouldValidateAsynchronously to remove confusion where the naming suggested this was an async method
  • Removed various methods from MessageFormatter that were deprecated in 8.x
  • PropertyValidatorContext.Instance renamed to InstanceToValidate for consistency with ValidationContext.
  • Removed DelegatingValidator which was deprecated in 8.x.

Downloads

Binaries can be downloaded from nuget:

9.0.0-preview5

06 Jul 14:47
Compare
Choose a tag to compare
9.0.0-preview5 Pre-release
Pre-release

Release notes

Please read the upgrade guide for full details: https://docs.fluentvalidation.net/en/latest/upgrading-to-9.html

Changes in 9.0-preview5

  • Remove IValidator.Validate(object) overload to improve typesafety (use a context if you need to preserve this behaviour)
  • Replace non-generic ValidationContext class with IValidationContext interface
  • ChildValidatorAdaptor and IncludeRule now require a generic type parameter indicating the root type being validated
  • Expression accessors for comparison properties are now cached where possible
  • {ComparisonProperty} placeholder now passes through the same logic as the {PropertyName} placeholder for consistency

Downloads

Binaries can be downloaded from nuget:

9.0-preview4

06 Jul 14:44
Compare
Choose a tag to compare
9.0-preview4 Pre-release
Pre-release

Release notes

Please read the upgrade guide for full details: https://docs.fluentvalidation.net/en/latest/upgrading-to-9.html

Changes in 9.0-preview4

  • {CollectionIndex} placeholder can now be accessed in child validators
  • Additional ValidationException constructor that allows customising the default message.
  • ScalePrecisionValidator algorithm now more consistent with SQL server (#1356)
  • Add Icelandic translations of default messages (#1362)
  • Additional When predicate overload that takes a ValidationContext
  • Fixes to range clientside validators when using datetimes (#1371)
  • Drop unsupported .NET Core versions from platform list

Downloads

Binaries can be downloaded from nuget:

9.0-preview3

06 Jul 14:40
Compare
Choose a tag to compare
9.0-preview3 Pre-release
Pre-release

Release notes

Please read the upgrade guide for full details: https://docs.fluentvalidation.net/en/latest/upgrading-to-9.html

Changes in 9.0-preview3

  • ASP.NET Core validator provider is now public
  • Ensure ASP.NET Core providers aren't registered twice
  • SoureLink integration
  • Additional overload of SetValidator that receives property value in callback
  • PropertyRule.ApplySharedCondition is now public
  • Remove lowercase placeholders from ScalePrecisionValidator

Downloads

Binaries can be downloaded from nuget:

9.0-preview2

21 Feb 15:28
bc6cab3
Compare
Choose a tag to compare

Release notes

Please read the upgrade guide for full details: https://docs.fluentvalidation.net/en/latest/upgrading-to-9.html

Changes since 9.0-preview1

  • Transform can now be used to transform a property value to another type prior to validation occurring
  • Added WithMessageArgument to test helper extensions
  • Added Slovenian translations of default error messages.
  • Fixes/better handling of the non-generic overloads of AbstractValidator.Validate
  • Removed the deprecated FluentValidation.Internal.Comparer
  • TrackingCollection has been marked as internal
  • Updated to latest version of Microsoft.NETFramework.ReferenceAssemblies for building net4x targets on non-windows platforms.

Downloads

Binaries can be downloaded from nuget:

9.0-preview1

19 Feb 11:21
Compare
Choose a tag to compare
9.0-preview1 Pre-release
Pre-release

Release notes

Please read the upgrade guide for full details: https://docs.fluentvalidation.net/en/latest/upgrading-to-9.html

  • Removed support for netstandard1.1, netstandard1.6, net45 (Supported platforms are now netstandard2, net461, netcoreapp2.1, netcoreapp3.0, netcoreapp3.1)
  • Removed WithLocalizedMessage (WithMessage that takes a callback is the replacement)
  • Removed ResourceName from ValidationFailure
  • Removed ResourceName and ResourceType from IStringSource.
  • Removed SetCollectionValidator which was deprecated in 8.0
  • Additional overload of OnAnyFailure that can receive a collection of validation failures
  • Remove DisplayAttribute integration and reference to DataAnnotations.
  • Default email validation mode now uses the same logic as ASP.NET Core. Previous regex behaviour is opt-in.
  • ComparisonProperty placeholder is now formatted like PropertyName.
  • TestHelper syntax improvements
  • Equal/NotEqual now perform ordinal comparisons on string properties by default
  • Severity can be set with a callback
  • PropertyValidator.ShouldValidateAsync reanamed to ShouldValidateAsynchronously to remove confusion where the naming suggested this was an async method
  • Removed various methods from MessageFormatter that were deprecated in 8.x
  • PropertyValidatorContext.Instance renamed to InstanceToValidate for consistency with ValidationContext.
  • Removed DelegatingValidator which was deprecated in 8.x.

Downloads

Binaries can be downloaded from nuget:

8.6.1

19 Feb 11:14
Compare
Choose a tag to compare

Release notes

  • Adds an explicit netcoreapp3.1 target for FluentValidation.AspNetCore.

Downloads

Binaries can be downloaded from nuget: