Skip to content

Releases: micro-elements/MicroElements.Swashbuckle.FluentValidation

v7.0.4-beta.3

14 Feb 15:09
9ed5bf7

Choose a tag to compare

v7.0.4-beta.3 Pre-release
Pre-release

Changes in 7.0.4-beta.3

  • Removed: Deprecated FluentValidation.AspNetCore package reference from test project (Issue #164)
    • Replaced with FluentValidation.DependencyInjectionExtensions 12.0.0, the official non-deprecated successor
    • Aligns test project with sample projects that already use FluentValidation.DependencyInjectionExtensions

v7.0.4-beta.2

14 Feb 14:49
7804753

Choose a tag to compare

v7.0.4-beta.2 Pre-release
Pre-release

Support for Keyed DI Services (Issue #165)

Validators registered via keyed DI services (.NET 8+) are now discovered automatically:

services.AddKeyedScoped<IValidator<MyModel>, MyModelValidator>("myKey");

What's new

  • Validators registered via AddKeyedScoped, AddKeyedTransient, AddKeyedSingleton are now discovered automatically
  • Works with both GetValidator (OperationFilter/DocumentFilter) and GetValidators (SchemaFilter) paths
  • Registration order independent — keyed validators registered before or after AddFluentValidationRulesToSwagger() are discovered
  • Deduplication: same validator registered as both keyed and non-keyed is returned only once
  • Graceful fallback: no impact when keyed services are not used or DI container doesn't support IKeyedServiceProvider

Full Changelog: v7.0.4-beta.1...v7.0.4-beta.2

v7.0.4-beta.1

14 Feb 13:18
4f224c2

Choose a tag to compare

v7.0.4-beta.1 Pre-release
Pre-release

Changes in 7.0.4-beta.1

  • Fixed: [AsParameters] types in minimal API and [FromQuery] container types create unused schemas in components/schemas (Issue #180)
    • GetSchemaForType() registers schemas in SchemaRepository as a side-effect of GenerateSchema()
    • Added check-and-cleanup: snapshot existing schema IDs before processing, remove side-effect schemas after applying validation rules to parameters
    • Fix applied to both default path (FluentValidationOperationFilter) and experimental path (FluentValidationDocumentFilter)

Install from MyGet

# Add MyGet feed (if not already added)
dotnet nuget add source https://www.myget.org/F/micro-elements/api/v3/index.json -n micro-elements

# Install pre-release package
dotnet add package MicroElements.Swashbuckle.FluentValidation --version 7.0.4-beta.1

Packages published

  • MicroElements.Swashbuckle.FluentValidation 7.0.4-beta.1
  • MicroElements.OpenApi.FluentValidation 7.0.4-beta.1
  • MicroElements.NSwag.FluentValidation 7.0.4-beta.1

7.0.3

23 Dec 13:13
4e58bca

Choose a tag to compare

Changes in 7.0.3

  • Fixed: NullReferenceException when models contain nested object properties (Issue #176 extended)
    • Handle OpenApiSchemaReference for nested class properties in OpenApiRuleContext
    • Add safe TryGetValue check in NSwagRuleContext

7.0.2

23 Dec 10:42
fda86d2

Choose a tag to compare

Fixed: InvalidCastException when models contain enum properties (Issue #176)

  • In Microsoft.OpenApi 2.x, enum properties are represented as OpenApiSchemaReference instead of OpenApiSchema
  • Filter out schema references in GetProperties() method to avoid cast exception

7.0.1

09 Dec 10:06
5322ec5

Choose a tag to compare

Changes in 7.0.1

  • Fixed: FluentValidation rules not applied to [FromForm] parameters (Issue #170)
    • Added RequestBody processing in FluentValidationOperationFilter for multipart/form-data and application/x-www-form-urlencoded content types

v.7.0.0

07 Dec 19:15
830d795

Choose a tag to compare

Changes in 7.0.0

New Features

  • Add .NET 10 target framework support
  • Add Swashbuckle.AspNetCore v10 compatibility
  • Add Microsoft.OpenApi 2.x support via conditional compilation
  • Create OpenApiSchemaCompatibility layer for cross-version support

Compatibility Matrix

Version .NET Swashbuckle Microsoft.OpenApi
7.x net10.0 10.x 2.x
7.x net8.0/net9.0 8.x 1.x

v.6.1.1

01 Sep 08:25
8562d85

Choose a tag to compare

Changes in 6.1.1

  • Fixed test project compilation errors that prevented building with
    .NET 9.0 SDK
  • Added missing package references (FluentValidation.AspNetCore,
    Swashbuckle.AspNetCore.Annotations)
  • Removed orphaned #endif directive in SwaggerTestHost.cs
  • Added null check for ISchemaGenerator to prevent
    NullReferenceException

6.1.0

25 Nov 23:08
7faf8d8

Choose a tag to compare

Changes in 6.1.0

  • Added support for .NET 8 and .NET 9 to MicroElements.Swashbuckle.FluentValidation.AspNetCore
  • Dropped support for .NET 6.0
  • Updated NJsonSchema to version 10.6.10

What's Changed

New Contributors

Full Changelog: v.6.0.0...v.6.1.0

6.0.0

03 Dec 19:45

Choose a tag to compare

Changes in 6.0.0

  • see changelog for betas

Changes in 6.0.0 - beta.3:

  • Added: IFluentValidationRuleProvider can be replaced with DI
  • Added: ISchemaGenerationOptions.ValidatorSearch
    • IsOneValidatorForType: bool; Value true: Gets only one validator (default), false: Gets all suitable validators (new)
    • SearchBaseTypeValidators: allows to search base type validators
  • Fixed: Stack Overflow Exception when using recursive validator type (PR#122 by @rachelpetitto)
  • Deleted: FluentValidationRulesRegistrator
  • Deleted: SwaggerGenOptions from filters
  • Many minor code cleanups

Changes in 6.0.0 - beta.2:

  • Codebase unified with NSwag
  • Added: MicroElements.NSwag.FluentValidation package. Early version
  • Change: INameResolver removed from FluentValidationRules ctor. Set it from SchemaGenerationOptions
  • Change: ISchemaGenerationSettings merged to ISchemaGenerationOptions
  • Change: IValidatorRegistry and it's implementations moved to MicroElements.OpenApi.FluentValidation namespace and package
  • Change: IValidatorRegistry can return more than one validator with method GetValidators
  • Added: ValidatorSearch strategy OneForType, ManyForType
  • Added: ISchemaGenerationOptions.ValidatorFilter, ISchemaGenerationOptions.RuleFilter, ISchemaGenerationOptions.RuleComponentFilter
    • Default Rule and RuleComponent filters checks that rule or component has no conditions.
    • Default ValidatorFilter checks that validator CanValidateInstancesOfType
  • Change: UseAllOfForMultipleRules typo fix

Changes in 6.0.0 - beta.1:

  • Abstracted common logic for NSwag
  • Moved from IValidationFactory (obsolete in FV 11.1.0) to IValidationRegistry
  • Supported FluentValidation 11 AddFluentValidationAutoValidation
  • Removed HttpContextServiceProviderValidatorFactory
  • Experimental DocumentFilter