Data Transformation intermediate 12 min

Inspect an Unfamiliar JSON Response Before Changing It

Trace paths, arrays, and inconsistent records in an unfamiliar response before changing the code that consumes it.

Scenario

The frontend mapper reads user.plan.name and started returning undefined after an API deploy. Cannot read properties of undefined (reading 'name') means the path is stale — but guessing the new path from memory is how the next undefined shows up. The response actually moved plans into an array, and you need to inspect that structure before rewriting any path strings.

Broken input

{"user":{"id":42,"plans":[{"name":"starter"},{"name":"pro"}]},"meta":{"requestId":"req_123"}}

Goal

Use Toolzy JSON Explore to trace where values actually live in the nested response. Tree, source, search, and exact paths make the object-vs-array distinction impossible to miss — the exact distinction dot-path code gets wrong.

Tool sequence

  1. Open Toolzy JSON Explore.
  2. Paste the current response from the network tab — not the response from the docs, which may predate the deploy.
  3. Search for plans, select it in the tree, and use the source highlight to confirm that it fans out into indexed array items.
  4. Read the real path: plan names live at user.plans[0].name and user.plans[1].nameuser.plan no longer exists, which is exactly why the mapper returns undefined.
  5. Update the mapper to handle the array (pick, map, or find), then validate the assumption holds across responses with JSON Schema Validator / Generator.

Checkpoint output

root
├─ user
│  ├─ id: 42
│  └─ plans []        ← array, not object
│     ├─ 0 → name: "starter"
│     └─ 1 → name: "pro"
└─ meta → requestId: "req_123"

Plan names live inside the user.plans[] array; user.plan.name is a path into an object that no longer exists.

Common mistakes

  • Guessing object paths from memory or old documentation instead of the live response.
  • Ignoring arrays while writing dot-path code — plans.name silently reads a property off an array and returns undefined.
  • Changing mapper code before confirming whether the response changed or the code was always wrong.
  • Fixing the path for index [0] and assuming the plan you want is always first.

Related tools and lessons