DOC-6842 Add redis-rb (Ruby) JSON docs - #3629
Conversation
…mmand mappings Preemptive, parked docs for redis-rb's JSON module (merged upstream in redis-rb #1346-#1349 but not yet in a released gem — the latest is v5.4.1 from July 2025, which predates the module). Adds a Ruby port of the json_tutorial doctest set and redis_rb signatures across the 22 JSON.* command-api-mapping files. Foundation for the redis-rb Query Engine docs, which index JSON documents and will build on this. Two non-obvious things for whoever edits these next. First, data/examples.json is deliberately absent from this change: it is git-ignored and generated, and the new Ruby tab on the JSON data-type page comes entirely from the dt_json.rb source via build/local_examples.py (.rb maps to ruby maps to the "Ruby" tab). Do not hand-add a Ruby entry there. Second, the example's expected outputs and REMOVE-block asserts are not guesses — the file was run against the local redis-rb fork (master) on Redis 8.8 and passed all 18 steps, so the only remaining risk is the upstream API changing before the gem ships. Learned: examples.json is generated (Ruby tab derives from the .rb source); example outputs were run-verified against the redis-rb fork, not guessed Constraint: regenerate data/command-api-mapping.json with build/merge-command-api-mapping.sh after editing per-command files — never hand-edit the merged file Directive: parked — do not merge until redis-rb ships the JSON module in a released gem Recheck: next redis-rb gem release (currently unreleased; JSON module is master-only) Gaps: verified against fork master on Redis 8.8, not a released gem — re-run the example at pickup Ticket: DOC-6842 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… steps Adds raw: true examples to the set_get, arr, arr2, and obj steps of the Ruby JSON tutorial, per maintainer feedback (vladvildanov on PR #3629): raw input (pass an already-encoded JSON string, skipping serialization) and raw output (get the unparsed JSON string back instead of a Ruby object). These land only on the Ruby tab of those shared steps because raw: is a redis-rb-specific kwarg — the other clients on the json_tutorial set have no equivalent option, so the raw lines are deliberately not mirrored to their tabs. Re-verified end-to-end against the redis-rb fork (master) on Redis 8.8 — all asserts pass, including the five new raw ones. Directive: the raw: examples are Ruby-only by design (redis-rb-specific kwarg) — don't mirror them to other clients' tabs on these shared json_tutorial steps Ticket: DOC-6842 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🧠 Redis MemoryFound 5 related items from repository history:
Memory updated at 6c69e3f |
|
Unpark reflection (predicted vs actual) — 2026-07-31 redis-rb 6.0.0 was published to rubygems.org on 2026-07-31 (07:14 UTC), the first release later than v5.4.1 to carry
Branch merged up to date with |
Adds Ruby (redis-rb) coverage for the JSON data type.
What's here
local_examples/tmp/datatypes/json/dt_json.rb— a Ruby port of the sharedjson_tutorialdoctest set (all 18 steps), using redis-rb'sjson_*methods. This also demonstrates redis-rb'sraw:option (pass an already-encoded JSON string / get the unparsed JSON string back) on theset_get,arr,arr2, andobjsteps.redis_rbmethod signatures added to the 22JSON.*command-api-mapping files (descriptions from redis-rb's YARD docs), withdata/command-api-mapping.jsonregenerated viabuild/merge-command-api-mapping.sh.Notes for reviewers
dt_json.rbat build time viabuild/local_examples.py(.rb→ theRubytab).data/examples.jsonis git-ignored/generated, so it is intentionally not in this diff — nothing to hand-add there.raw:lines are Ruby-only by design (it's a redis-rb-specific kwarg); the other clients on these sharedjson_tutorialsteps have no equivalent, so they're deliberately not mirrored to their tabs.Verification
dt_json.rbruns green against the released redis-rb 6.0.0 gem (published to rubygems.org 2026-07-31) on Redis 8.8 with the JSON module — exit 0, all 18assert_equalblocks pass. redis-rb 6.0.0 is a breaking major (RESP3 by default); it changed none of thejson_*return shapes.