Add configurable RemoveUnusedQuerySchemas option (Issue #180)#190
Closed
Add configurable RemoveUnusedQuerySchemas option (Issue #180)#190
Conversation
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>
Resolve conflicts: keep 7.0.5 version, preserve 7.1.0-beta.1 changelog entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
Replaced by release/v7.0.5 branch — hotfix off v7.0.4 without merging master (7.1.0-beta.1) |
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
RemoveUnusedQuerySchemasoption (default:true) toSchemaGenerationOptionsallowing users to opt out of the v7.0.4 schema cleanupfalse, container type schemas created for[FromQuery]/[AsParameters]types are preserved incomponents/schemasfor use by custom DocumentFiltersUser-facing API
Changes
ISchemaGenerationOptions.csRemoveUnusedQuerySchemasto interface and class (defaulttrue)SchemaGenerationOptionsExtensions.csSetFrom()FluentValidationOperationFilter.csFluentValidationDocumentFilter.csAsParametersTests.csCHANGELOG.mdversion.propsADR-002-configurable-schema-cleanup.mdTest plan
truepreserves v7.0.4 behavior)Default_RemoveUnusedQuerySchemas_Should_Be_True— verifies defaultOperationFilter_Should_Preserve_Schemas_When_RemoveUnusedQuerySchemas_Is_False— opt-out works in OperationFilterDocumentFilter_Should_Preserve_Schemas_When_RemoveUnusedQuerySchemas_Is_False— opt-out works in DocumentFilterDocumentFilter_Should_Cleanup_ContainerType_Schemas_By_Default— default cleanup works in DocumentFilter🤖 Generated with Claude Code