MinApiLib.Validation 11.0.0

dotnet add package MinApiLib.Validation --version 11.0.0
                    
NuGet\Install-Package MinApiLib.Validation -Version 11.0.0
                    
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="MinApiLib.Validation" Version="11.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinApiLib.Validation" Version="11.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MinApiLib.Validation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MinApiLib.Validation --version 11.0.0
                    
#r "nuget: MinApiLib.Validation, 11.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MinApiLib.Validation@11.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MinApiLib.Validation&version=11.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MinApiLib.Validation&version=11.0.0
                    
Install as a Cake Tool

license version

MinApiLib.Validation

Deprecated. Use MinApiLib.FluentValidation instead. This package no longer receives fixes, and its types are marked [Obsolete].

Known problems

The filter validates data annotations only on a request member named Body. It skips validation without any error if the member has another name, or if the body is received directly as a handler parameter. It doesn't check query, route or header values.

Migrating

Replace the package:

dotnet remove package MinApiLib.Validation
dotnet add package MinApiLib.FluentValidation

Update the usings, and register the validators:

// global using MinApiLib.Validation;
global using FluentValidation;
global using MinApiLib.FluentValidation;
// ...
builder.Services.AddValidatorsFromAssembly();

Move each annotation to a validator for the request. WithValidation() stays the same in the endpoint.

// Before
public record struct Request([FromBody] RequestBody Body);

public class RequestBody
{
    [Required, StringLength(150, MinimumLength = 3)]
    public string Name { get; set; }
}

// After
public record struct Request([FromBody] RequestBody Body);

public class RequestBody
{
    public string Name { get; set; }
}

public class RequestValidator : AbstractValidator<Request>
{
    public RequestValidator()
    {
        RuleFor(x => x.Body.Name).NotEmpty().Length(3, 150);
    }
}

The 400 response keeps the same shape, with the errors per property, but the keys include the path of the property, such as Body.Name. An endpoint that calls WithValidation() needs a validator: without one, its requests aren't validated, and a warning is logged.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
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
11.0.0 93 11/10/2026
10.0.1 1,619 9/14/2026
10.0.0 5,977 11/19/2025
9.0.0 13,446 11/13/2024
8.0.1 4,464 4/11/2024
8.0.0 7,056 12/14/2023
7.0.4 4,885 5/17/2023
7.0.3 543 4/18/2023
7.0.2 500 3/22/2023
7.0.1 412 3/21/2023
7.0.0 556 2/14/2023
7.0.0-beta 344 11/10/2022