fix: use 'is not None' checks for json parameter to preserve falsy values#622
fix: use 'is not None' checks for json parameter to preserve falsy values#622
Conversation
…lues
Truthiness checks (if json) silently dropped valid falsy JSON payloads
like 0, "", [], {}, and False. For example, posting json=[] would not
serialize or send the empty list. Changed to explicit None checks.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #622 +/- ##
=======================================
Coverage 76.02% 76.02%
=======================================
Files 42 42
Lines 2482 2482
=======================================
Hits 1887 1887
Misses 595 595
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pijukatel
left a comment
There was a problem hiding this comment.
I would be worried that maybe we rely on this behavior somewhere...
Could you please add some tests with some values that would be previously ignored and now they would be handled?
Might be the case. Closing and let's resolve it for the 3.x. |
Summary
_prepare_request_callused truthiness checks (if json) to detect JSON payloads0,"",[],{},Falsejson=[](empty list) would not be serialized or sent to the APIis not NoneTest plan
http_client.call(..., json=[])correctly sends an empty JSON array🤖 Generated with Claude Code