Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#3837·openai-python

Querystring drops explicit empty-string scalar values

Author: sylvesterkaczmarekCreated Sep 10, 2026Updated Sep 23, 2026
Labelsv4sdk-breaking-change

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

python
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=.

Source: openai/openai-python

View original on GitHubView discussion on GitHub