Skip to content

Draft API for connection and template layers for Redis JSON commands - #3327

Open
Dgramada wants to merge 22 commits into
spring-projects:mainfrom
Dgramada:topic/JSON-API-draft-for-connection-and-template-layer
Open

Draft API for connection and template layers for Redis JSON commands#3327
Dgramada wants to merge 22 commits into
spring-projects:mainfrom
Dgramada:topic/JSON-API-draft-for-connection-and-template-layer

Conversation

@Dgramada

Copy link
Copy Markdown
Contributor

Provides a draft version of how the JSON template and connection layer API should look like. The purpose of this PR is to receive feedback and to get a better feeling of what should Spring Data Redis provide for users that would like to use Redis JSON.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 11, 2026
@mp911de
mp911de marked this pull request as draft March 12, 2026 14:03

@onobc onobc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋🏻 @Dgramada ,

Thanks for the PR - it is great to see the feature being added. I have left a few comments to address / points to discuss.

Comment thread src/main/java/org/springframework/data/redis/core/json/JsonArrayRange.java Outdated
Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
Comment thread src/main/java/org/springframework/data/redis/core/json/JsonPath.java Outdated
@Dgramada

Copy link
Copy Markdown
Contributor Author

If the interfaces are acceptable, I could close this issue and create a separate one that introduces them alongside their implementations and testing. Would you prefer this approach or would you like me to extend this PR?

Comment thread src/main/java/org/springframework/data/redis/core/json/JsonPath.java Outdated
@onobc

onobc commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

If the interfaces are acceptable,
I do - they are at a nice simple starting point.

I could close this issue and create a separate one that introduces them alongside their implementations and testing.
Would you prefer this approach or would you like me to extend this PR?

I would just rock this PR (continue on from this point).

Thank you for the quick turnaround - I was on PTO - sorry for the delay.

@Dgramada
Dgramada force-pushed the topic/JSON-API-draft-for-connection-and-template-layer branch from 0680f61 to 275ca3e Compare March 24, 2026 12:56
…perations.

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
@Dgramada
Dgramada force-pushed the topic/JSON-API-draft-for-connection-and-template-layer branch from 275ca3e to 2f2f6d3 Compare March 24, 2026 13:02
Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
…s. Added connection layer logic for blocking layer. Removed redundant asserts in RedisJsonCommands default methods.

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
Comment thread src/main/java/org/springframework/data/redis/core/JsonOperations.java Outdated
…urn type in multiple RedisJsonCommands methods.

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
…sonCommands overload to RedisConnectionUnitTests. Updated @SInCE to 4.1.

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
@onobc
onobc self-requested a review March 27, 2026 19:43

@onobc onobc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋🏻 @Dgramada I left a couple comments to address. Thanks.

Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
…mmands.

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
@Dgramada
Dgramada marked this pull request as ready for review April 22, 2026 14:35
…Unmarked.

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
Comment thread src/main/java/org/springframework/data/redis/connection/RedisJsonCommands.java Outdated
Dgramada added 2 commits May 27, 2026 16:51
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
…rently Jedis has a very inconsistent API compared to Lettuce and changes the data type. Added safely encoded strings to JedisJsonCommands for value params

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Dgramada added 3 commits May 29, 2026 14:16
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
@mp911de

mp911de commented Jun 3, 2026

Copy link
Copy Markdown
Member

I think we're closing in on a first solid design here. I'd suggest drawing some inspiration from 28f5665 (on the Json branch in this repository), particularly around JsonValue. There ought to be a JsonType (analogous to DataType) residing in the connection.json package, alongside JsonValue itself. We may well reuse JsonType later on within JsonResult.

I'd propose finalizing the JsonCommands parts first, so that we can then approach JsonOperations and JsonTemplate as a separate, second step. Splitting the effort into two pieces keeps the complexity manageable on both ends.

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Comment thread src/main/java/org/springframework/data/redis/connection/json/JsonValue.java Outdated
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 15, 2026
@Dgramada Dgramada mentioned this pull request Jun 29, 2026
4 tasks
@Dgramada

Copy link
Copy Markdown
Contributor Author

Both the branch and pull request have become quite bloated. I created a new clean branch with all the current code plus the template layer built on top of it. We can close this pull request and continue with the new clean pull request.

@mp911de
mp911de force-pushed the main branch 2 times, most recently from e0163c7 to 5e76bfb Compare August 5, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants