Audit a Nested Inventory Response with the JSON Viewer
Use tree navigation, search, paths, and type counts to inspect a small inventory response without mistaking presentation for data validation.
By DevSphere Editorial · · 5 min read
Open JSON ViewerStart with a bounded question
A JSON response can be syntactically valid and still be difficult to review. The JSON Viewer helps when the immediate question is structural: which locations exist, what types are present, and whether repeated records carry the fields a consumer expects. It parses the editor contents with the browser's JSON parser, then presents tree, raw, or formatted views. It does not retrieve a response from an API, infer a schema, or decide whether a value is business-correct. Keep the exercise focused on a harmless sample or a sanitized response. For this walkthrough, imagine a fictional equipment catalog exported by a demo storefront. We want to confirm that every item has a stock count, that one nested specification exists, and that an explicit null is not confused with an absent key. A tight question is easier to answer than visually scanning a large document without a checklist.
{
"warehouse": "North Demo",
"items": [
{"sku": "LAMP-01", "stock": 8, "spec": {"watts": 12}},
{"sku": "MUG-02", "stock": 0, "spec": null}
],
"generated": true
}
Load and orient the tree
Open JSON Viewer from the data tools and paste the sample into the JSON Input editor. The validation status should change from Awaiting JSON to Valid JSON, and the adjacent Tree View should expose an object containing warehouse, items, and generated. If you prefer a known baseline, use Load Sample first, then replace its contents with the fictional inventory. Leave View Mode at Tree View for the first pass. The root is expanded initially, and container nodes have individual toggles; the global Collapse All and Expand All buttons provide a quick way to change the overall density. Expand items to see two indexed records and then open the first record's spec object. The second record's spec is displayed as null, not as a collapsible object. This distinction matters: a consumer may treat null as an intentional placeholder, whereas an absent property would not appear at all. The tree is a visual index, not an editable form, so return to the input editor to make changes.
items[0].spec.watts -> number 12
items[1].spec -> null
Search, paths, and counts
Use Search keys/values to test one focused claim at a time. Searching for stock highlights matching field names; searching for 0 can locate the zero-stock value. The search marks matching tree nodes but does not filter away unrelated nodes or count matches, so inspect the surrounding record to understand context. Beneath the workspace, the Quick Access Paths list can show paths such as items[0].spec.watts and items[1].spec. It lists at most twenty entries and indicates the JavaScript type of each path value; it is not a full JSONPath editor and paths are not clickable queries. The JSON statistics summarize objects, arrays, keys, strings, numbers, booleans, and nulls. For this sample expect one root object, an items array, two record objects, one nested spec object, and one null. Recount against the example rather than using the totals as a schema assertion: these counts describe the entire parsed document and don't say which record violates a requirement.
Compare raw and normalized views
Switch View Mode to Raw to see exactly the characters currently in the editor, including compact spacing. Formatted shows a two-space JSON.stringify rendering, and Copy Formatted or Copy Minified places one of those serializations on the clipboard. Format rewrites the editor to the formatted rendering; Minify rewrites it to compact JSON. These actions change whitespace, not the underlying parsed values, so they are useful for a readable review or a small payload handoff. Compare the output before using it downstream, especially if key order is meaningful to a human diff. JSON objects are treated as unordered by the standard, but serializers can preserve insertion order in their output. This tool does not calculate an API schema, validate units, or explain why stock is zero. Keep a separate checklist for required keys, acceptable ranges, and domain meaning, then use the tree to inspect each checklist item. A second reviewer can confirm the same paths directly in Raw or Formatted mode.
Troubleshoot and verify
If the status becomes Invalid JSON, the tree and summary counts are withheld. Check for single-quoted strings, an unquoted key, a trailing comma, a missing comma between members, or text before or after the one JSON value. JSON requires double-quoted property names and strings. Correct the source rather than relying on a visual guess, then confirm Valid JSON returns. Large or deeply nested inputs may be cumbersome to explore; narrow the review to a relevant sanitized fragment when permitted instead of assuming this page is a performance profiler. Before sharing results, verify the sample's known facts: there are two item records, the first stock is eight, the second is zero, the first watts value is twelve, and the second spec is null. Clear removes the editor text and search term, making it easier to start a separate inspection. Avoid pasting private production records into an unapproved environment; use invented identifiers like those above and confirm your organization's data-handling rules first.
A useful review record separates observations from decisions. Note that the tree shows a null spec on MUG-02, then consult the catalog contract separately to learn what null means. If every item is expected to contain a numeric watts value, the visible null is a finding for the owner, not a value the viewer can repair or explain. Keep a compact checklist of required field, expected type, acceptable range, and policy for missing or null. Use the same path for each item so a second reviewer can reproduce the inspection. When an export contains many records, consider building a small fixture with representative edge cases rather than manually opening every node. The interface makes navigation quick, but it does not prove completeness across a large production dataset.