Skip to content

fix(api): serialize falsy query params#1874

Closed
kinderjoypresents wants to merge 1 commit intoProjectOpenSea:mainfrom
kinderjoypresents:fix/query-params-falsy-values
Closed

fix(api): serialize falsy query params#1874
kinderjoypresents wants to merge 1 commit intoProjectOpenSea:mainfrom
kinderjoypresents:fix/query-params-falsy-values

Conversation

@kinderjoypresents
Copy link
Contributor

Motivation

Query parameter serialization should not drop valid falsy values such as 0 or false. The previous implementation could omit these values when building URLSearchParams, leading to incorrect requests (e.g. limit=0 or boolean flags not being sent).

Solution

  • Updated serialize all values except null and undefined (including 0, false, and empty strings).
  • Preserved array handling while ensuring array items also skip only null/undefined.
  • Added a unit test: verifies the generated request URL includes limit=0 and include=false.

@ryanio
Copy link
Collaborator

ryanio commented Jan 16, 2026

Opened a PR for a cleaner approach to this, thanks as always for your contributions!

@ryanio ryanio closed this Jan 16, 2026
@kinderjoypresents
Copy link
Contributor Author

Opened a PR for a cleaner approach to this, thanks as always for your contributions!

Ok bro. It was last mine.

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