Skip to content

Querystring drops explicit empty-string scalar values #3837

Description

@sylvesterkaczmarek

Querystring.stringify() drops an explicit empty-string scalar because _stringify_item() checks the serialized value with a truthiness test.

stringify({"filter": ""}) == ""  # current behavior

This conflates an explicit empty value with None. In a URL query, filter= is distinct from omitting filter entirely. The behavior is also inconsistent across array formats, where an empty string can be retained by comma serialization.

Expected behavior: continue omitting None, but serialize an explicit empty string as filter=.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdk-breaking-changeCandidate SDK breaking change for major-release triage; inclusion is not a release commitment.v4Planned for Python SDK v4

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions