Flips behavior, validate by default, opt out with Lenient #4720
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.
Description
Take 2 on #4718. This allows the client to specify "Lenient" to opt out of validation...
This pull request includes several changes to improve the handling of search parameter validation in the FHIR server, particularly focusing on the differentiation between strict and lenient handling modes.
Enhancements to Handling Modes:
src/Microsoft.Health.Fhir.Core/Extensions/PreferHeaderExtensions.cs
: Refactored theGetIsStrictHandlingEnabled
method to return a boolean directly based on theGetHandlingHeader
method, which now checks forSearchParameterHandling.Strict
. [1] [2]src/Microsoft.Health.Fhir.Core/Features/Operations/Export/CreateExportRequestHandler.cs
: Updated theValidateTypeFilters
method to log and skip validation whenSearchParameterHandling.Lenient
is specified.Test Adjustments:
test/Microsoft.Health.Fhir.Shared.Tests.Integration/Features/Operations/Export/CreateExportRequestHandlerTests.cs
: Modified test cases to reflect the changes in handling modes, including renaming test methods to specify lenient handling and removing hardcoded strict handling headers. [1] [2] [3] [4]Related issues
Addresses AB#130227
Testing
Unit tests.
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)