Skip to content

Properly serialize null values in V2#1786

Merged
mbroshi-stripe merged 1 commit intomasterfrom
mbroshi/v2-null-params
Feb 16, 2026
Merged

Properly serialize null values in V2#1786
mbroshi-stripe merged 1 commit intomasterfrom
mbroshi/v2-null-params

Conversation

@mbroshi-stripe
Copy link
Copy Markdown
Contributor

@mbroshi-stripe mbroshi-stripe commented Feb 12, 2026

Why?

In #1758, we addressed an issue where nil parameters were not being serialized in V2 endpoints. Unlike in V1 (where you use an empty string "" for emptying), in V2 to empty a hash, you need to set it to null.

The above PR actually broke (some) V2 GET requests because it attempts to serialize nil on GET's instead of just POST's. For query parameters, say for a List method, that will become ?limit=, which will be interpreted by the server as an empty string "", which is not a valid integer for limit.

So, this PR puts in the proper fix on master. We will amend beta and private-preview branches with this new logic in other PRs.

What?

  • Serializes nil values in V2 POST requests

Changelog

  • Fixes a bug where V2 POST requests were not serializing null values.

@mbroshi-stripe mbroshi-stripe requested a review from a team as a code owner February 12, 2026 21:20
@mbroshi-stripe mbroshi-stripe changed the title Do not serialize nil on V2 GETs Properly serialize null values in V2 Feb 13, 2026
@mbroshi-stripe mbroshi-stripe merged commit e6c9453 into master Feb 16, 2026
15 checks passed
@mbroshi-stripe mbroshi-stripe deleted the mbroshi/v2-null-params branch February 16, 2026 18:09
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.

2 participants