Skip to content

Add RFC6901 json pointer support #2930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leonchen83
Copy link

@leonchen83 leonchen83 commented Feb 28, 2022

Now Path can convert RFC6901 style path to json path
for example
Path.ofJosnPointer("/abc/0") can convert to Path.of(".[\"abc\"].[0]")

the limitation of JsonPointer path is /abc/0 always convert to .[\"abc\"].[0] and not .[\"abc\"].[\"0\"]
if users want to use .abc.0, they should use Path.of(".abc.0") instead of Path.ofJosnPointer("/abc/0")

@sazzad16
Copy link
Contributor

@leonchen83 We generally avoid adding utilities. Perhaps RedisJSON itself can start supporting RFC6901?

@leonchen83
Copy link
Author

leonchen83 commented Feb 28, 2022

@sazzad16
yes. but since 2017 to present. there is not an implementation of rfc6901 from RedisJSON.
related issue #3 , #18.
so client side implementation is an option

Now Path can convert RFC6901 style path to json path
for example
Path.ofJosnPointer("/abc/0") can convert to Path.of(".[\"abc\"].[0]")

the limitation of JsonPointer path is /abc/0 always convert to .[\"abc\"].[0] and not .[\"abc\"].[\"0\"]
if users want to use .abc.0, they should use Path.of(".abc.0") instead of Path.ofJosnPointer("/abc/0")
@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2022

Codecov Report

Merging #2930 (6a260f3) into master (80d01d2) will increase coverage by 0.17%.
The diff coverage is 85.45%.

❗ Current head 6a260f3 differs from pull request most recent head e18598c. Consider uploading reports for the commit e18598c to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2930      +/-   ##
============================================
+ Coverage     55.14%   55.32%   +0.17%     
- Complexity     3166     3188      +22     
============================================
  Files           195      196       +1     
  Lines         12119    12174      +55     
  Branches        691      706      +15     
============================================
+ Hits           6683     6735      +52     
- Misses         5207     5208       +1     
- Partials        229      231       +2     
Impacted Files Coverage Δ
...ain/java/redis/clients/jedis/json/JsonPointer.java 84.90% <84.90%> (ø)
src/main/java/redis/clients/jedis/json/Path.java 100.00% <100.00%> (ø)
src/main/java/redis/clients/jedis/json/Path2.java 73.91% <100.00%> (+5.73%) ⬆️
src/main/java/redis/clients/jedis/Protocol.java 89.17% <0.00%> (+1.27%) ⬆️
...nts/jedis/providers/ClusterConnectionProvider.java 81.81% <0.00%> (+3.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80d01d2...e18598c. Read the comment docs.

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

Successfully merging this pull request may close these issues.

3 participants