Skip to content

Release v7.0.5: Add configurable RemoveUnusedQuerySchemas option (Issue #180)#191

Closed
avgalex wants to merge 1 commit intomasterfrom
release/v7.0.5
Closed

Release v7.0.5: Add configurable RemoveUnusedQuerySchemas option (Issue #180)#191
avgalex wants to merge 1 commit intomasterfrom
release/v7.0.5

Conversation

@avgalex
Copy link
Member

@avgalex avgalex commented Feb 26, 2026

Summary

Hotfix release 7.0.5 based on v7.0.4 tag (cherry-picked, no 7.1.0-beta.1 code).

  • Added RemoveUnusedQuerySchemas option (default: true) to SchemaGenerationOptions
  • When set to false, container type schemas for [FromQuery]/[AsParameters] types are preserved in components/schemas for use by custom DocumentFilters
  • Fixes regression reported by @thunderstatic in #180 (comment)

User-facing API

services.AddFluentValidationRulesToSwagger(options =>
{
    options.RemoveUnusedQuerySchemas = false;
});

Changes

File Change
ISchemaGenerationOptions.cs Added RemoveUnusedQuerySchemas to interface and class (default true)
SchemaGenerationOptionsExtensions.cs Copy new property in SetFrom()
FluentValidationOperationFilter.cs Conditional snapshot/cleanup based on flag
FluentValidationDocumentFilter.cs Conditional snapshot/cleanup based on flag
AsParametersTests.cs 4 new tests (default value, OperationFilter opt-out, DocumentFilter opt-out, DocumentFilter default cleanup)
CHANGELOG.md v7.0.5 entry
version.props 7.0.5
ADR-002-configurable-schema-cleanup.md Architecture decision record

Test plan

  • All existing tests pass (default true preserves v7.0.4 behavior)
  • New tests validate both default and opt-out paths for OperationFilter and DocumentFilter
  • Builds and tests pass on net8.0, net9.0, net10.0

🤖 Generated with Claude Code

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>
@avgalex
Copy link
Member Author

avgalex commented Feb 26, 2026

Release branch doesn't need a PR to master — will tag and release directly, then cherry-pick fix into master separately.

@avgalex avgalex closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant