Breaking change: Skip null values for form, header and query parameters#90
Merged
Breaking change: Skip null values for form, header and query parameters#90
Conversation
…erParam Co-authored-by: twogood <[email protected]>
Co-authored-by: twogood <[email protected]>
Copilot
AI
changed the title
[WIP] Breaking change: null values for form, header and query parameters should skip adding that parameter
Breaking change: Skip null values for form, header and query parameters
Aug 4, 2025
twogood
approved these changes
Aug 6, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a breaking change to skip null values for query, form, and header parameters instead of converting them to empty strings. The change affects QueryParamAttribute, FormParamAttribute, and HeaderParamAttribute handling in the RequestHandler.GetParams() method.
Key changes:
- Modified parameter processing logic to skip null values entirely
- Updated dictionary parameter handling to use explicit null checks
- Added comprehensive test coverage for null parameter scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Activout.RestClient/Implementation/RequestHandler.cs | Modified GetParams() method to skip null values for all parameter types and updated dictionary handling with explicit null checks |
| Activout.RestClient.Test/NullParameterTests.cs | Added comprehensive test suite covering null parameter handling for query, form, and header parameters |
| Activout.RestClient.Test/DictionaryParameterTests.cs | Updated existing tests to use WithExactQueryString and adjusted expectations for null value handling |
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.
This PR implements a breaking change where null values for
QueryParamAttribute,FormParamAttribute, andHeaderParamAttributeare completely skipped instead of being converted to empty strings.Changes Made
Modified
RequestHandler.GetParams()to add null checks before adding parameters:Breaking Change Behavior
Before this change:
After this change:
What's Preserved
"") are still added as parametersUse Cases
If you want an empty parameter value, explicitly pass an empty string:
This change affects all three parameter types:
QueryParamAttribute,FormParamAttribute, andHeaderParamAttribute.Fixes #89.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.