FluentValidationLister.Filter 1.0.2

.NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
dotnet add package FluentValidationLister.Filter --version 1.0.2
NuGet\Install-Package FluentValidationLister.Filter -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FluentValidationLister.Filter" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FluentValidationLister.Filter --version 1.0.2
#r "nuget: FluentValidationLister.Filter, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install FluentValidationLister.Filter as a Cake Addin
#addin nuget:?package=FluentValidationLister.Filter&version=1.0.2

// Install FluentValidationLister.Filter as a Cake Tool
#tool nuget:?package=FluentValidationLister.Filter&version=1.0.2

Installation

  1. Install the NuGet package

  2. In the ConfigureServices method of Startup.cs, include a call to AddFluentValidationFilter instead of AddFluentValidation.

public void ConfigureServices(IServiceCollection services)
{
    ...

    services.AddFluentValidationFilter();
}
  1. In order for ASP.NET to discover your validators, they must be registered with the services collection. You must do this by calling the AddTransient method for each of your validators. Adding all validators in a specified assembly is not supported.
    services.AddFluentValidationFilter();

    services.AddTransient<IValidator<Person>, PersonValidator>();
    // (repeat for every validator)

How to use

For any given endpoint, add the query-string ?validation=1 to the endpoint URL in order to view the validator details, if applicable.

Example output for JSON:

{
  "rules": {
    "foreName": {
      "required": true,
      "length": {
        "min": 2,
        "max": 10
      }
    },
    "address.line1": {
      "required": true
    }
  },
  "messages": {
    "foreName": {
      "required": "'Forename' must not be empty.",
      "length": "'Forename' must be between 2 and 10 characters."
    },
    "address.line1": {
      "required": "'Line1' must not be empty."
    }
  }
}

AJAX validation

For unsupported validators or validators with custom server-side logic, the rule will be presented as "remote" - the field can be validated using an AJAX call to the back-end.

You can validate any particular field by adding the query string validate=fieldName and if the field is not valid, a problem details will be returned including errors only relevant to the specified field.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.0 749 4/30/2022
1.3.0 233 3/13/2022
1.2.2 177 12/24/2021
1.2.1 186 8/6/2021
1.2.0 283 8/1/2021
1.1.2 952 10/4/2020
1.1.0 303 8/20/2020
1.0.10 327 8/19/2020
1.0.9 319 8/4/2020
1.0.7 389 2/19/2020
1.0.6 683 12/14/2019
1.0.5 450 12/4/2019
1.0.4 383 11/15/2019
1.0.3 409 11/6/2019
1.0.2 415 11/4/2019
1.0.1 463 10/24/2019
1.0.0 444 10/23/2019

Bug fixes for XML support