Skip to content

Releases: FluentValidation/FluentValidation

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:

8.6.0

19 Feb 11:13
8424a13
Compare
Choose a tag to compare

Release notes

  • Added support for ASP.NET Core 3.1
  • Fixed issue with property indexers being incorrectly stripped out when using test extensions.
  • AddToModelState no longer includes a dot if PropertyName is null

Downloads

Binaries can be downloaded from nuget:

8.5.1

04 Nov 12:09
Compare
Choose a tag to compare

Release notes

  • Ensure lazily loaded calls to WithMessage can be used for client-side validation, provided they don't attempt to access model properties from inside the delegate (eg when using IStringLocalizer).
  • Fix issue where OnFailure didn't work properly when invoked on validators with conditions.

Downloads

Binaries can be downloaded from nuget:

8.5.0

24 Sep 11:23
Compare
Choose a tag to compare

Release notes

  • Add support for ASP.NET Core 3.
  • Add ASP.NET Core-compatible version of the email address validator.
  • Simplify the advanced test-helper syntax.
  • Add support for defining child rules inline when using RuleForEach.
  • ValidatorDescriptor now has consistent handling of model-level rules.
  • RuleForEach can now access collection index in error message with {CollectionIndex} placeholder.
  • Welsh language translations of default error messages.
  • Hungrian language translations of default error messages.
  • Indonesian language translations of default error messages.
  • Using RuleForEach combined with When has more intuitive behaviour.
  • Fixed order of rule execution when using async validation.

Of these new features, the main one to note is the new ChildRules syntax. When defining a rule against a collection of complex types, rules for the child properties can be defined directly inline rather than having to use a child validator:

public class CustomerValidator : AbstractValidator<Customer> {
  public CustomerValidator() {
    RuleForEach(x => x.Orders).ChildRules(order => {
      order.RuleFor(x => x.ProductName).NotNull();
      order.RuleFor(x => x.Amount).GreaterThan(0);
    });
  }
}

Downloads

Binaries can be downloaded from nuget:

8.4.0

24 Sep 10:44
Compare
Choose a tag to compare

Release notes

  • Added simplified version of several messages across all translations to aid with ASP.NET Clientside validation.
  • New enum validator for string properties.

Downloads

Binaries can be downloaded from nuget:

8.3.0

24 Sep 10:45
Compare
Choose a tag to compare

Release notes

  • Fix issue in ASP.NET Core integration with GetServiceProvider not working correctly when invoked against a CustomContext/MessageBuilderContext.
  • Improved how LanguageStringSource works with error-code overrides.
  • Fix thread-safety issue with use of PropertyValidatorOptions.Empty (now removed).
  • Improved how calls to When/Unless are handled internally.
  • DelegatingValidator is now marked as deprecated.
  • Improvements to Croatian language translations.
  • Improvements to Georgian language translations.
  • Resolved subtle bug where top-level WhenAsync wouldn't work correctly when wrapping a top-level call to When.

8.2.3

24 Sep 10:46
Compare
Choose a tag to compare

Release Notes

  • Fix issue with WebApi integration where DataAnnotations validation could generate duplicate messages when used in the same project as FluentValidation.