MicroElements.Swashbuckle.FluentValidation
7.1.7-beta.2
Prefix Reserved
See the version list below for details.
dotnet add package MicroElements.Swashbuckle.FluentValidation --version 7.1.7-beta.2
NuGet\Install-Package MicroElements.Swashbuckle.FluentValidation -Version 7.1.7-beta.2
<PackageReference Include="MicroElements.Swashbuckle.FluentValidation" Version="7.1.7-beta.2" />
<PackageVersion Include="MicroElements.Swashbuckle.FluentValidation" Version="7.1.7-beta.2" />
<PackageReference Include="MicroElements.Swashbuckle.FluentValidation" />
paket add MicroElements.Swashbuckle.FluentValidation --version 7.1.7-beta.2
#r "nuget: MicroElements.Swashbuckle.FluentValidation, 7.1.7-beta.2"
#:package MicroElements.Swashbuckle.FluentValidation@7.1.7-beta.2
#addin nuget:?package=MicroElements.Swashbuckle.FluentValidation&version=7.1.7-beta.2&prerelease
#tool nuget:?package=MicroElements.Swashbuckle.FluentValidation&version=7.1.7-beta.2&prerelease
Swagger ISchemaFilter that uses FluentValidation validators instead System.ComponentModel based attributes.
| Product | Versions 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. |
-
net10.0
- MicroElements.OpenApi.FluentValidation (>= 7.1.7-beta.2)
- Swashbuckle.AspNetCore.SwaggerGen (>= 10.0.0)
-
net8.0
- MicroElements.OpenApi.FluentValidation (>= 7.1.7-beta.2)
- Swashbuckle.AspNetCore.SwaggerGen (>= 8.1.1)
-
net9.0
- MicroElements.OpenApi.FluentValidation (>= 7.1.7-beta.2)
- Swashbuckle.AspNetCore.SwaggerGen (>= 8.1.1)
NuGet packages (52)
Showing the top 5 NuGet packages that depend on MicroElements.Swashbuckle.FluentValidation:
| Package | Downloads |
|---|---|
|
Reo.Core.Queue.RabbitMq
Package Description |
|
|
Reo.Core.Email
Package Description |
|
|
Mii.Rinjani.Gateway.Commons
Package Description |
|
|
H21.AspNetCore.Validation
Package Description |
|
|
WalletFramework.AspNetCore.Contracts
Api Library |
GitHub repositories (4)
Showing the top 4 popular GitHub repositories that depend on MicroElements.Swashbuckle.FluentValidation:
| Repository | Stars |
|---|---|
|
AlphaYu/adnc
A pragmatic .NET 8 framework for modular monoliths to evolve seamlessly into distributed microservices.
|
|
|
AntonioFalcaoJr/EventualShop
A state-of-the-art distributed system using Reactive DDD as uncertainty modeling, Event Storming as subdomain decomposition, Event Sourcing as an eventual persistence mechanism, CQRS, Async Projections, Microservices for individual deployable units, Event-driven Architecture for efficient integration, and Clean Architecture as domain-centric design
|
|
|
nhonvo/clean-architecture-net-8.0
Clean Architecture Web API Project
|
|
|
melikpehlivanov/AuctionSystem
Auction system written in ASP.NET Core
|
| Version | Downloads | Last Updated |
|---|---|---|
| 7.1.7-beta.3 | 51 | 6/17/2026 |
| 7.1.7-beta.2 | 55 | 6/17/2026 |
| 7.1.7-beta.1 | 61 | 6/15/2026 |
| 7.1.6 | 23,297 | 6/2/2026 |
| 7.1.6-beta.1 | 50 | 6/2/2026 |
| 7.1.5-beta.2 | 348 | 5/16/2026 |
| 7.1.5-beta | 415 | 4/1/2026 |
| 7.1.4 | 218,468 | 3/29/2026 |
| 7.1.4-beta | 145 | 3/24/2026 |
| 7.1.3 | 11,337 | 3/24/2026 |
| 7.1.2 | 62,928 | 3/9/2026 |
| 7.1.1 | 1,593 | 3/9/2026 |
| 7.1.0 | 1,554 | 3/9/2026 |
| 7.1.0-beta.2 | 75 | 3/6/2026 |
| 7.1.0-beta.1 | 226 | 2/23/2026 |
| 7.0.6 | 22,075 | 3/3/2026 |
| 7.0.5 | 11,504 | 2/26/2026 |
| 7.0.4 | 52,170 | 2/17/2026 |
| 7.0.4-beta.3 | 71 | 2/14/2026 |
| 7.0.4-beta.2 | 70 | 2/14/2026 |
$# Changes in 7.1.7
- Fixed: A validator for a nested type bound via `[FromQuery]` was reflected in the OpenAPI document even when it was **not** wired into the root validator via `SetValidator`/`ChildRules` (Issue #211)
- `FluentValidationOperationFilter` resolved the leaf container's validator directly from the registry (by `ModelMetadata.ContainerType`), so a nested `NotEmpty()` marked the flattened parameter (e.g. `RequiredSubType.SubProperty`) as `required` even though FluentValidation never validates an unwired child object — the OpenAPI doc claimed `required`, but the API accepted requests without it
- Fix: for a flattened nested parameter, nested rules are now applied only when the `SetValidator`/`ChildRules` chain from the action's root `[FromQuery]` validator actually reaches the leaf container; otherwise the parameter is left unconstrained, matching runtime behavior
- When the root container type cannot be resolved, prior behavior is preserved (no regression for existing nested-parameter scenarios)
- Behavioral change: when no validator is registered for the root `[FromQuery]` type (only a leaf/child validator is registered), a flattened nested parameter is now left unconstrained — matching runtime, where no validation runs without a root validator
- Fixed: A required leaf property inside an **optional** nested type bound via `[FromQuery]` was wrongly marked as a required parameter (Issue #209)
- The 7.1.1 fix (Issue #162) made nested `[FromQuery]` validation match the leaf property name, but `FluentValidationOperationFilter` then set `required` based solely on the leaf type, ignoring whether the ancestor segment of the dot-path was optional
- Because two nested properties of the same leaf type share one schema/validator (e.g. `OptionalSubType.SubProperty` and `RequiredSubType.SubProperty`), a `NotEmpty()` on the leaf marked **both** flattened parameters as required
- Fix: a flattened nested parameter is now marked `required` only when **every** ancestor segment of the dot-path is required — resolved from the action's root `[FromQuery]` type, combining the native schema `required` (e.g. the C# `required` modifier) with FluentValidation `NotNull`/`NotEmpty` rules
- Value constraints (e.g. `minLength`) still apply to an optional nested parameter when it is provided
- When the root container type cannot be resolved, prior behavior is preserved (no regression for existing nested-parameter scenarios)
# 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
- 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