-
Notifications
You must be signed in to change notification settings - Fork 1.1k
DOC-5378 reactive JSON doc examples #3432
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
andy-stark-redis
wants to merge
2
commits into
redis:main
Choose a base branch
from
andy-stark-redis:DOC-5378-reactive-json-examples
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
DOC-5378 reactive JSON doc examples #3432
andy-stark-redis
wants to merge
2
commits into
redis:main
from
andy-stark-redis:DOC-5378-reactive-json-examples
+521
−0
Conversation
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
a-TODO-rov
reviewed
Dec 19, 2025
Contributor
a-TODO-rov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment
Comment on lines
+241
to
+283
| String inventory_json_str = "{" + " \"inventory\": {" + " \"mountain_bikes\": [" + " {" | ||
| + " \"id\": \"bike:1\"," + " \"model\": \"Phoebe\"," | ||
| + " \"description\": \"This is a mid-travel trail slayer that is a " | ||
| + "fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset " | ||
| + "gives plenty of gear range to tackle hills and there\u2019s room for mudguards " | ||
| + "and a rack too. This is the bike for the rider who wants trail manners with " + "low fuss ownership.\"," | ||
| + " \"price\": 1920," | ||
| + " \"specs\": {\"material\": \"carbon\", \"weight\": 13.1}," | ||
| + " \"colors\": [\"black\", \"silver\"]" + " }," + " {" | ||
| + " \"id\": \"bike:2\"," + " \"model\": \"Quaoar\"," | ||
| + " \"description\": \"Redesigned for the 2020 model year, this " | ||
| + "bike impressed our testers and is the best all-around trail bike we've ever " | ||
| + "tested. The Shimano gear system effectively does away with an external cassette, " | ||
| + "so is super low maintenance in terms of wear and tear. All in all it's an " | ||
| + "impressive package for the price, making it very competitive.\"," + " \"price\": 2072," | ||
| + " \"specs\": {\"material\": \"aluminium\", \"weight\": 7.9}," | ||
| + " \"colors\": [\"black\", \"white\"]" + " }," + " {" | ||
| + " \"id\": \"bike:3\"," + " \"model\": \"Weywot\"," | ||
| + " \"description\": \"This bike gives kids aged six years and older " | ||
| + "a durable and uberlight mountain bike for their first experience on tracks and easy " | ||
| + "cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes " | ||
| + "provide ample stopping ability. If you're after a budget option, this is one of the " | ||
| + "best bikes you could get.\"," + " \"price\": 3264," | ||
| + " \"specs\": {\"material\": \"alloy\", \"weight\": 13.8}" + " }" + " ]," | ||
| + " \"commuter_bikes\": [" + " {" + " \"id\": \"bike:4\"," | ||
| + " \"model\": \"Salacia\"," | ||
| + " \"description\": \"This bike is a great option for anyone who just " | ||
| + "wants a bike to get about on With a slick-shifting Claris gears from Shimano\u2019s, " | ||
| + "this is a bike which doesn\u2019t break the bank and delivers craved performance. " | ||
| + "It\u2019s for the rider who wants both efficiency and capability.\"," | ||
| + " \"price\": 1475," | ||
| + " \"specs\": {\"material\": \"aluminium\", \"weight\": 16.6}," | ||
| + " \"colors\": [\"black\", \"silver\"]" + " }," + " {" | ||
| + " \"id\": \"bike:5\"," + " \"model\": \"Mimas\"," | ||
| + " \"description\": \"A real joy to ride, this bike got very high scores " | ||
| + "in last years Bike of the year report. The carefully crafted 50-34 tooth chainset " | ||
| + "and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the " | ||
| + "high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step " | ||
| + "frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb " | ||
| + "throttle. Put it all together and you get a bike that helps redefine what can be " | ||
| + "done for this price.\"," + " \"price\": 3941," | ||
| + " \"specs\": {\"material\": \"alloy\", \"weight\": 11.6}" + " }" + " ]" | ||
| + " }" + "}"; |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving this in .json file or at least as class constant.
Contributor
|
Also we have new raw JSON API since 7.0 |
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.
Make sure that:
mvn formatter:formattarget. Don’t submit any formatting related changes.DOC-5378
Reactive examples for the main JSON data type page and the Path sub-page.
All suggestions about style, etc, are welcome, but a couple of things to note are:
toString()results in tests to simplify them, even though it's not good practice generally to rely ontoString()being consistent.System.out::printlnmethod reference works naturally. However, there are other places in the published example where the only code visible in adoOnNext()call is a lambda of the formr -> {System.out.println(r);}. This looks like it could be replaced by the same method reference. However, it actually happens because there are also asserts in aREMOVE_START/REMOVE_ENDblock in the lambda after theprintlncall. It works fine, but if you think it looks like bad style to have this mix of method references and equivalent lambdas, then I'll see what I can do to fix it.