Skip to content

JSON.GET never returns an array #3711#3712

Closed
tishun wants to merge 1 commit into
redis:mainfrom
tishun:topic/tishun/issue-3711
Closed

JSON.GET never returns an array #3711#3712
tishun wants to merge 1 commit into
redis:mainfrom
tishun:topic/tishun/issue-3711

Conversation

@tishun
Copy link
Copy Markdown
Collaborator

@tishun tishun commented Apr 3, 2026

Deprecate the wrong API and provide a new one, based on how the JSON.GET works.

Closes #3711

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

Note

Medium Risk
Introduces new jsonGetValue* methods and deprecates existing jsonGet* list-returning APIs, which can impact downstream consumers (especially coroutines) despite being source-compatible for Java via deprecation only.

Overview
Aligns the JSON.GET API with Redis behavior by adding single-result methods: jsonGetValue(...) returning JsonValue and jsonGetValueRaw(...) returning a raw String, implemented across async/reactive/sync, cluster node selection, and coroutines.

Marks the existing jsonGet(...)/jsonGetRaw(...) list-returning methods as deprecated (since they imply multiple bulk replies), adds a new JsonValueOutput for parsing a single reply, and expands integration tests to cover multi-key/multi-path behavior and the new single-value APIs.

Written by Cursor Bugbot for commit c07e1b4. This will update automatically on new commits. Configure here.

@tishun tishun requested review from Dgramada, a-TODO-rov and ggivo April 3, 2026 07:17
@tishun
Copy link
Copy Markdown
Collaborator Author

tishun commented May 26, 2026

After discussing this with @a-TODO-rov we decided that we should drop this issue.

Some of the reasons:

  • the issue is mostly a usability fix, the List would never contain more than one entry
  • to address this API change we would have to introduce yet another set of methods, and we already have two sets (one deals with the String version of the API, another handles the object-driven API); both sets of methods provide multiple overrides and this bloats the API
  • we might address this in some subsequent effort when we harmonize the APIs of Jedis and Lettuce

@tishun tishun closed this May 26, 2026
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.

JSON.GET never returns an array

1 participant