Skip to content

DOC-6842 Add redis-rb (Ruby) JSON docs - #3629

Merged
andy-stark-redis merged 3 commits into
mainfrom
DOC-6842-redis-rb-json-docs
Jul 31, 2026
Merged

DOC-6842 Add redis-rb (Ruby) JSON docs#3629
andy-stark-redis merged 3 commits into
mainfrom
DOC-6842-redis-rb-json-docs

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Adds Ruby (redis-rb) coverage for the JSON data type.

What's here

  • Example: local_examples/tmp/datatypes/json/dt_json.rb — a Ruby port of the shared json_tutorial doctest set (all 18 steps), using redis-rb's json_* methods. This also demonstrates redis-rb's raw: option (pass an already-encoded JSON string / get the unparsed JSON string back) on the set_get, arr, arr2, and obj steps.
  • Command mappings: redis_rb method signatures added to the 22 JSON.* command-api-mapping files (descriptions from redis-rb's YARD docs), with data/command-api-mapping.json regenerated via build/merge-command-api-mapping.sh.

Notes for reviewers

  • The Ruby tab on the JSON data-type page is generated from dt_json.rb at build time via build/local_examples.py (.rb → the Ruby tab). data/examples.json is git-ignored/generated, so it is intentionally not in this diff — nothing to hand-add there.
  • The raw: lines are Ruby-only by design (it's a redis-rb-specific kwarg); the other clients on these shared json_tutorial steps have no equivalent, so they're deliberately not mirrored to their tabs.
  • Foundation for the redis-rb Query Engine docs (DOC-6843 Add redis-rb (Ruby) Query Engine docs: queryjson #3641), which index JSON documents.

Verification

dt_json.rb runs 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 18 assert_equal blocks pass. redis-rb 6.0.0 is a breaking major (RESP3 by default); it changed none of the json_* return shapes.

…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>
@andy-stark-redis andy-stark-redis added do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

DOC-6842

@andy-stark-redis andy-stark-redis self-assigned this Jul 14, 2026
Comment thread local_examples/tmp/datatypes/json/dt_json.rb
… 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>
@andy-stark-redis
andy-stark-redis requested a review from a team July 31, 2026 09:21
@andy-stark-redis andy-stark-redis added clients Client library docs and removed do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history:

Memory updated at 6c69e3f

@andy-stark-redis

Copy link
Copy Markdown
Contributor Author

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 lib/redis/commands/modules/json.rb. Trigger fired.

  • Predicted at park: possible signature/return-shape drift in json.rb between fork master (fa90f44) and the eventual release.
  • Actual: zero drift — v6.0.0's json.rb is the identical commit fa90f44; the compare fa90f44...v6.0.0 touches no module file (only adds an unrelated upstream example).
  • Runtime re-verify: dt_json.rb ran green against the released 6.0.0 gem on Redis 8.8 (ReJSON) — exit 0, all 18 assert_equal blocks. The 6.0.0 RESP3-as-default change did not alter any json_* return shape.
  • Reconciliation: none needed — this PR adds no .md page (example + 23 JSON.* mappings only); data/examples.json stays git-ignored/generated.

Branch merged up to date with main (109 commits, no conflicts); hugo --gc builds clean (the two pre-existing REF_NOT_FOUND warnings are in operate/rs/8.0/flex/_index.md, unrelated). Ready for /finalize.

@andy-stark-redis andy-stark-redis changed the title DOC-6842 Add redis-rb (Ruby) JSON docs [PARKED] DOC-6842 Add redis-rb (Ruby) JSON docs Jul 31, 2026
@andy-stark-redis
andy-stark-redis merged commit 4cb079e into main Jul 31, 2026
85 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-6842-redis-rb-json-docs branch July 31, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants