MicroElements.OpenApi.FluentValidation 7.1.6-beta.1

Prefix Reserved
This is a prerelease version of MicroElements.OpenApi.FluentValidation.
There is a newer version of this package available.
See the version list below for details.
dotnet add package MicroElements.OpenApi.FluentValidation --version 7.1.6-beta.1
                    
NuGet\Install-Package MicroElements.OpenApi.FluentValidation -Version 7.1.6-beta.1
                    
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="MicroElements.OpenApi.FluentValidation" Version="7.1.6-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MicroElements.OpenApi.FluentValidation" Version="7.1.6-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="MicroElements.OpenApi.FluentValidation" />
                    
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 MicroElements.OpenApi.FluentValidation --version 7.1.6-beta.1
                    
#r "nuget: MicroElements.OpenApi.FluentValidation, 7.1.6-beta.1"
                    
#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 MicroElements.OpenApi.FluentValidation@7.1.6-beta.1
                    
#: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=MicroElements.OpenApi.FluentValidation&version=7.1.6-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MicroElements.OpenApi.FluentValidation&version=7.1.6-beta.1&prerelease
                    
Install as a Cake Tool

Package Description

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on MicroElements.OpenApi.FluentValidation:

Package Downloads
MicroElements.Swashbuckle.FluentValidation

Swagger ISchemaFilter that uses FluentValidation validators instead System.ComponentModel based attributes.

MicroElements.NSwag.FluentValidation

Adds FluentValidation rules to swagger schema.

MicroElements.AspNetCore.OpenApi.FluentValidation

Applies FluentValidation rules to OpenAPI schemas generated by Microsoft.AspNetCore.OpenApi (IOpenApiSchemaTransformer).

X2031.MicroElements.NSwag.FluentValidation

Adds FluentValidation rules to swagger schema.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.1.6 314 6/2/2026
7.1.6-beta.1 30 6/2/2026
7.1.5-beta.2 166 5/16/2026
7.1.5-beta 429 4/1/2026
7.1.4 156,989 3/29/2026
7.1.4-beta 1,113 3/24/2026
7.1.3 10,197 3/24/2026
7.1.2 55,978 3/9/2026
7.1.1 608 3/9/2026
7.1.0 540 3/9/2026
7.1.0-beta.2 408 3/6/2026
7.1.0-beta.1 1,450 2/23/2026
7.0.6 19,547 3/3/2026
7.0.5 10,501 2/26/2026
7.0.4 47,194 2/17/2026
7.0.4-beta.3 81 2/14/2026
7.0.4-beta.2 68 2/14/2026
7.0.4-beta.1 78 2/14/2026
7.0.3 205,780 12/23/2025
7.0.2 781 12/23/2025
Loading failed

$# Changes in 7.1.6
- Fixed: `$ref` still replaced with an inline copy (and the child component left orphaned) when nested object constraints come from `ChildRules` or an inline child validator (Issue #198, comment 4601720562)
 - The 7.1.3 fix restored unmodified `$ref`s, but when the nested type had no standalone validator its component schema gained its `Required` only after the parent's inline snapshot, so the stale `Required` diverged and defeated the restore check — leaving an inline copy and an orphaned component
 - Fix: the `Required` comparison in `HasValidationConstraintChanges` is now directional — restoration is only blocked when the inline copy carries a required entry the component lacks
 - `SetValidator` (with a standalone child validator) was already correct; `BigInteger`/enum per-model constraints (Issues #146/#176) continue to work

# Changes in 7.1.5
- Added: `ConditionalRulesMode` option to control how `.When()`/`.Unless()` conditional rules are handled during schema generation (Issue #203)
 - `Exclude` (default): conditional rules are excluded from the schema (backward-compatible, existing behavior)
 - `Include`: conditional rules are included in the schema (useful when `.When()` is a null-guard and constraints should still appear)
 - `IncludeWithWarning`: same as `Include` but logs a warning for each conditional rule included
 - Usage: `options.ConditionalRules = ConditionalRulesMode.Include;`
- Fixed: Multiple `.Matches()` rules on one property displayed incorrectly — only the first pattern shown, property duplicated (Issue #204)
 - Multiple patterns were placed into separate `allOf` subschemas, which Swagger UI/Redoc/Scalar collapse, keeping only the first `pattern`
 - Now multiple `.Matches()` rules are combined into a single `pattern` via lookahead assertions (e.g. `(?=[\s\S]*(?:[a-z]))(?=[\s\S]*(?:[A-Z]))`), preserving `.Matches()` semantics and rendering correctly
 - Applied to all providers: Swashbuckle, `MicroElements.AspNetCore.OpenApi.FluentValidation`, and NSwag (NSwag previously kept only the last pattern)
 - Changed: `SchemaGenerationOptions.UseAllOfForMultipleRules` default `true` → `false`; set it to `true` to keep the legacy `allOf` representation

# Changes in 7.1.4
- Added: `FluentValidationOperationTransformer` (`IOpenApiOperationTransformer`) for `MicroElements.AspNetCore.OpenApi.FluentValidation` (Issue #200)
 - Query parameters with `[AsParameters]` now receive validation constraints (min/max, required, pattern, etc.)
 - Supports container type resolution with fallback via reflection for `[AsParameters]`
 - Copies validation constraints from schema properties to parameter schemas
 - Registered automatically via `AddFluentValidationRules()`
- Fixed: Nested DTOs in request body not receiving validation constraints (Issue #200)
 - `FluentValidationSchemaTransformer` skipped all property-level schemas, but for nested object types this was the only transformer call
 - Now processes property-level schemas for complex types using the property type's validator

# Changes in 7.1.3
- Fixed: `$ref` replaced with inline schema copy when using `SetValidator` with nested object types (Issue #198)
 - `ResolveRefProperty` (introduced in 7.1.2 for BigInteger isolation) replaced all `$ref` properties with copies, destroying reference structure in the OpenAPI document
 - Fix: snapshot `$ref` properties before rule application, restore them afterwards if no validation constraints were added by rules
 - BigInteger per-model constraints (Issue #146) continue to work correctly

# Changes in 7.1.2
- Added: `BigInteger` support for min/max validation constraints in OpenAPI schema generation (Issue #146)
 - `IsNumeric()` and `NumericToDecimal()` now handle `BigInteger` values
 - `BigInteger` properties with GreaterThan, LessThan, InclusiveBetween, ExclusiveBetween rules produce correct `minimum`/`maximum` in Swagger
 - NSwag provider updated with the same `BigInteger` support
 - Out-of-range `BigInteger` values (exceeding `decimal` range) are handled gracefully via existing try/catch
- Fixed: Shared schema mutation when multiple models reference the same `BigInteger` type with different constraints (net10.0)
 - `ResolveRefProperty` creates an isolated shallow copy before applying rule mutations
 - Prevents `$ref`-based schema corruption across models in `SchemaRepository`
- Fixed: Replaced deprecated `PackageLicenseUrl` with `PackageLicenseExpression` (Issue #144)
- Fixed: Replaced deprecated `PackageIconUrl` with embedded `PackageIcon`


Full release notes can be found at: https://github.com/micro-elements/MicroElements.Swashbuckle.FluentValidation/blob/master/CHANGELOG.md