Skip to content

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

Draft
Dgramada wants to merge 4 commits intospring-projects:mainfrom
Dgramada:topic/JSON-API-draft-for-connection-and-template-layer
Draft

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

Conversation

@Dgramada
Copy link
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).
…perations. Furthermore, added a JsonPath class for easier path creating for JSON methods in the template layer. These are draft classes and their purpose is to get feedback and an initial feeling of how the JSON API should look like. Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 11, 2026
…implementations for some of the overloaded classes. Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
@mp911de mp911de marked this pull request as draft March 12, 2026 14:03
Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
Copy link
Contributor

@onobc onobc left a comment

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.

* @see <a href="https://redis.io/docs/latest/commands/json.arrindex/">Redis JSON.ARRINDEX</a>
*/
@NullMarked
public final class JsonArrayRange {
Copy link
Contributor

Choose a reason for hiding this comment

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

We do have a Spring Data Range object org.springframework.data.domain.Range<T>. I wonder if we could that instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

When you get into the impl PTAL at this Range and see if it something we would want to re-use.

Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
@Dgramada
Copy link
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?

* @since 4.3
*/
@NullMarked
public final class JsonPath {
Copy link
Contributor

Choose a reason for hiding this comment

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

@mp911de what are your thoughts on using a record here instead? The eq/hc/ts cruft goes away.

@onobc
Copy link
Contributor

onobc commented Mar 20, 2026

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.

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

Labels

status: waiting-for-triage An issue we've not yet triaged

3 participants