Repository navigation
refactor(requests)!: serialize body parameters by value type, not by parameter name - #483
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## beta #483 +/- ##
============================================
+ Coverage 46.70% 46.86% +0.16%
- Complexity 692 696 +4
============================================
Files 209 209
Lines 6276 6295 +19
Branches 759 764 +5
============================================
+ Hits 2931 2950 +19
+ Misses 2783 2781 -2
- Partials 562 564 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dargmuesli
marked this pull request as ready for review
November 3, 2026 09:46
This was referenced Nov 3, 2026
Merged
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.
The body serializer kept a per-name allow-list of body parameters whose stringified values should be re-parsed back into JSON. That list is why remove-playlist-items shipped broken in #478:
itemswas not on it, so the JsonArray body went out as an escaped string, and the list itself only exists because of #421, which kept numeric-looking String values as strings. setBodyParameter now stores the value with its runtime type, and the serializer dispatches on that type: a JsonElement goes in as-is, a Boolean or Number as its literal, and everything else (in practice a String) as a JSON string. No per-name list to keep in sync, and a structured parameter can no longer silently become a string.The two tests that called the serializer directly now build the body the way the client sends it, via initializeBody() and reading the entity, so they assert on what actually goes over the wire.
AbstractRequest.bodyParametersToJson(List), an internal serialization helper that is not part of IRequest, is now a private method; the wire format of every request is unchanged and getBodyParameters() still returns the same name/value strings, so only direct callers of that helper see a compile error. RemovePlaylistItemsExample now uses the Collection overload added in #482 instead of hand-building a JsonArray.