JAAvila.FluentOperations.OpenApi 1.5.0

dotnet add package JAAvila.FluentOperations.OpenApi --version 1.5.0
                    
NuGet\Install-Package JAAvila.FluentOperations.OpenApi -Version 1.5.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="JAAvila.FluentOperations.OpenApi" Version="1.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JAAvila.FluentOperations.OpenApi" Version="1.5.0" />
                    
Directory.Packages.props
<PackageReference Include="JAAvila.FluentOperations.OpenApi" />
                    
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 JAAvila.FluentOperations.OpenApi --version 1.5.0
                    
#r "nuget: JAAvila.FluentOperations.OpenApi, 1.5.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 JAAvila.FluentOperations.OpenApi@1.5.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=JAAvila.FluentOperations.OpenApi&version=1.5.0
                    
Install as a Cake Addin
#tool nuget:?package=JAAvila.FluentOperations.OpenApi&version=1.5.0
                    
Install as a Cake Tool

JAAvila.FluentOperations.OpenApi

OpenAPI / Swagger schema filter integration for JAAvila.FluentOperations Quality Blueprints.

Automatically enriches Swashbuckle-generated OpenAPI schemas with validation constraints that mirror the rules defined in your QualityBlueprint<T> classes — no duplication needed.

Supported mappings

Blueprint operation OpenAPI constraint
NotBeNull property added to required
NotBeEmpty minLength: 1
NotBeNullOrEmpty minLength: 1 + required
HaveMinLength(n) minLength: n
HaveMaxLength(n) maxLength: n
HaveLengthBetween(a,b) minLength: a, maxLength: b
Match(pattern) pattern: <regex>
MatchRegex(regex) pattern: <regex>
BeEmail format: email
BeUrl format: uri
BeGreaterThan(n) minimum: n, exclusiveMinimum: true
BeLessThan(n) maximum: n, exclusiveMaximum: true
BeGreaterThanOrEqualTo minimum: n
BeLessThanOrEqualTo maximum: n
BeOneOf([...]) enum: [...]
Other operations x-validation-rules: [operationName]

Usage

// 1. Register your blueprints with DI (using JAAvila.FluentOperations.DependencyInjection)
builder.Services.AddFluentOperations()
    .AddBlueprint<UserBlueprint>();

// 2. Configure Swashbuckle to use the schema filter
builder.Services.AddSwaggerGen(options =>
{
    // Resolve blueprints from DI and apply to swagger generation
    var sp = builder.Services.BuildServiceProvider();
    var blueprints = sp.GetRequiredService<IEnumerable<IBlueprintValidator>>();
    options.AddFluentOperationsValidation(blueprints);
});

Blueprint example

public class UserBlueprint : QualityBlueprint<User>
{
    public UserBlueprint()
    {
        using (Define())
        {
            For(x => x.Email).Test().NotBeNull().BeEmail();
            For(x => x.Name).Test().NotBeNullOrEmpty().HaveMaxLength(100);
            For(x => x.Age).Test().BeGreaterThanOrEqualTo(18).BeLessThan(150);
        }
    }
}

The generated OpenAPI schema for User will automatically include:

  • email field as required, with format: email
  • name field as required, with maxLength: 100
  • age field with minimum: 18, maximum: 150, exclusiveMaximum: true
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 was computed.  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 was computed.  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. 
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
1.5.0 110 3/29/2026
1.3.0 100 3/26/2026
1.1.0 100 3/21/2026