u/RedoubtableBeast

Image 1 —
Image 2 —
▲ 10 r/json

Over the past week I’ve been deep in debugging a pretty gnarly multi-layer integration — the kind where you’re constantly staring at huge JSON payloads, trying to understand what’s actually inside, and then turning that into clear bug reports or questions for other teams.

Pretty quickly I got tired of manually digging through nested structures, broken payloads, and JSON-inside-JSON situations. So I ended up writing a small CLI tool for myself called jray.

The idea is simple: treat JSON like an “X-ray” problem. Instead of pretty-printing it, flatten it into a list of .path=value pairs so you can immediately see what’s there, no matter how deeply nested or messy it is. It is very friendly to grep or similar tools.

A few things that turned out to be especially useful:

  • It’s error-tolerant — even if the JSON is malformed or incomplete, you still get as much data as possible + context around the error
  • It unwraps embedded JSON (strings containing JSON) automatically
  • It also detects and expands Base64-encoded JSON (golang way to marshal binary data)
  • Recognizes timestamps and even UUIDv7 (extracts time from them)
  • Handles multiple JSON objects in a stream (JSONL)
  • Doesn’t break on duplicate keys

If you deal with messy JSON regularly, this might save you some time (and sanity).

Repo: https://github.com/michurin/jray

u/RedoubtableBeast — 12 days ago