Skip to content

Conversation

@andy-stark-redis
Copy link
Contributor

@andy-stark-redis andy-stark-redis commented Sep 3, 2025

Make sure that:

  • You have read the contribution guidelines.
  • 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.

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:

  • I'm following Tisho's comment on the corresponding async JSON PR that it's OK to use toString() results in tests to simplify them, even though it's not good practice generally to rely on toString() being consistent.
  • There are some places in the code where a System.out::println method reference works naturally. However, there are other places in the published example where the only code visible in a doOnNext() call is a lambda of the form r -> {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 a REMOVE_START/REMOVE_END block in the lambda after the println call. 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.

@andy-stark-redis andy-stark-redis marked this pull request as ready for review September 3, 2025 13:12
Copy link
Contributor

@a-TODO-rov a-TODO-rov left a 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}" + " }" + " ]"
+ " }" + "}";
Copy link
Contributor

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.

@a-TODO-rov
Copy link
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants