Skip to content

Fix v2 typed params sending nil values on GET requests#1788

Merged
mbroshi-stripe merged 1 commit intoprivate-previewfrom
mbroshi/v2-null-params-private-preview
Feb 16, 2026
Merged

Fix v2 typed params sending nil values on GET requests#1788
mbroshi-stripe merged 1 commit intoprivate-previewfrom
mbroshi/v2-null-params-private-preview

Conversation

@mbroshi-stripe
Copy link
Contributor

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

Why?

See #1786

What?

  • Does not serialize nil values on V2 GET requests

Changelog

  • Fixes a bug on V2 GET where we were serializing nil query parameters as empty strings. The server would return an error in such cases like 'limit: Expected an Integer value got: .'

objects_to_ids was preserving nil values for all v2 API requests,
but this caused issues on GET requests where nil values become
empty strings in query parameters, leading to API errors like:
"limit: Expected an Integer value got: ."

This change updates the logic to only preserve nil values in the
request body (for POST/PUT/PATCH requests) where they are needed
for v2 semantics, while filtering them from query parameters
(for GET/HEAD/DELETE requests).

Changed from symbol-based semantics parameter to a boolean
serialize_empty parameter for clarity.

Committed-By-Agent: claude
@mbroshi-stripe mbroshi-stripe requested a review from a team as a code owner February 13, 2026 22:27
@mbroshi-stripe mbroshi-stripe requested review from jar-stripe and removed request for a team February 13, 2026 22:27
@mbroshi-stripe mbroshi-stripe merged commit 5919399 into private-preview Feb 16, 2026
15 checks passed
@mbroshi-stripe mbroshi-stripe deleted the mbroshi/v2-null-params-private-preview branch February 16, 2026 18:08
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