Skip to content

fix: preserve falsy scalar JSON primitives in json_params_matcher (#834) - #836

Open
mayureshsonawane17 wants to merge 1 commit into
getsentry:masterfrom
mayureshsonawane17:fix/834-json-params-scalar-primitives
Open

mayureshsonawane17 wants to merge 1 commit into
getsentry:masterfrom
mayureshsonawane17:fix/834-json-params-scalar-primitives

Conversation

@mayureshsonawane17

Copy link
Copy Markdown

Summary

Fixes #834.

Previously, initialized using:

Because evaluates boolean truthiness, falsy valid JSON primitives (, , , ) were replaced with . This caused mocks expecting top-level JSON primitives to fail with a mismatch against .

This PR updates initialization to only default to when :

Test Plan

  • Added parameterized unit tests in covering scalar JSON primitives (, , , , , ).
  • Ran full test suite (all tests passing cleanly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

json_params_matcher fails on falsy top-level JSON primitives (0, False, "")

1 participant