Repository navigation
Preserve empty lists and zero in JSON request bodies - #1294
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1293.
Problem
The request serializer treats an empty list as a missing body and sends
null. This changes settings semantics:index.update_searchable_attributes([])resets the local server to["*"]rather than configuring[]. Displayed attributes and ranking rules have the same issue. Numeric zero also becomes null.Change
JSON-serialize every non-byte body except the existing empty-string sentinel. This preserves empty lists and zero while retaining
Noneasnull, booleans, empty dictionaries, raw bytes, empty strings, and the custom encoder argument.Add public SDK integration tests for searchable attributes, displayed attributes and ranking rules, verifying an empty list stays empty and
Nonestill resets the setting. Add wire-value controls for falsey request bodies.Validation
Using the locked
uv sync --frozenenvironment (Python 3.12) and an isolated official local Meilisearch 1.55.0 community server:tests/index: 174 passed, 2 failed becauseinlineRulerequires Enterprise Edition. Both failures reproduce on unchanged upstream source; they are unrelated to serialization.git diff --checkpasses.The full SDK/server matrix was not run. No hosted data or cloud account was used.
AI assistance: Codex assisted with source inspection, implementation, tests, and this description. The reproduction and regression checks were executed locally.