Fix AspNetCore.OpenApi.FluentValidation for .NET 10 + merge v7.0.5/v7.0.6#192
Merged
avgalex merged 4 commits intomicro-elements:masterfrom Mar 6, 2026
Merged
Conversation
…s#180) Add RemoveUnusedQuerySchemas property (default: true) to SchemaGenerationOptions to allow users to opt out of the v7.0.4 schema cleanup that removes side-effect schemas from components/schemas when processing [FromQuery]/[AsParameters] types. This fixes a regression where custom DocumentFilters that depend on these schemas stopped working after v7.0.4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…o-elements#180) On .NET 8, ModelMetadata.ContainerType is null for [AsParameters] decomposed parameters. Added AsParametersHelper fallback that resolves the container type via [AsParameters] reflection on MethodInfo. Applied in both FluentValidationOperationFilter and FluentValidationDocumentFilter. Zero regression on .NET 9/10. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ents#149) Change Scoped DI registrations to Transient for FluentValidationSchemaTransformer and IValidatorRegistry to support .NET 10 build-time document generation which runs without an HTTP scope. Add diagnostic logging, integration tests with WebApplicationFactory, and update sample app to target net9.0;net10.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merges configurable RemoveUnusedQuerySchemas option (v7.0.5) and [AsParameters] .NET 8 ContainerType null fix (v7.0.6) into the AspNetCore.OpenApi .NET 10 fix branch. Version remains 7.1.0-beta.2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scoped→TransientDI registration forFluentValidationSchemaTransformerandIValidatorRegistry— .NET 10 build-time document generation (OpenApiGenerateDocuments) runs without HTTP scope, causing scoped resolution to failPropertiesCount()helper for consistency inProcessAllSchemasOpenApiSchemaReferencenull behavior inGetProperty()net9.0;net10.0withCustomerTypeenumMicroElements.AspNetCore.OpenApi.FluentValidation.Tests) with 4 WebApplicationFactory-based testsRemoveUnusedQuerySchemasoption (Issue Validators for records used with [AsParameters] create unused component schemas #180)[AsParameters].NET 8ContainerTypenull fix (Issue Validators for records used with [AsParameters] create unused component schemas #180)7.1.0-beta.2Test plan
dotnet buildsucceeds for all target frameworksdotnet test --framework net9.0— 66 tests pass (62 Swashbuckle + 4 AspNetCore)dotnet test --framework net10.0— 56 tests pass (52 Swashbuckle + 4 AspNetCore)/openapi/v1.jsoncontains validation constraintsCustomerType) does not crash on .NET 10FluentValidationSchemaTransformerresolves without scope (build-time compat)🤖 Generated with Claude Code