What a JSON:API viewer does
A JSON:API document is not a single nested object. It is a graph: primary data contains
resources, relationships contain resource linkage (type and
id), and the full objects are collected in a separate top-level included array.
Reading that by hand means constantly jumping between arrays and matching identifiers.
A viewer resolves that structure for you. JSON:API Lens, the free viewer on this site, shows:
- primary resources and every included resource, grouped by type;
- attributes flattened into readable rows instead of raw JSON;
- relationships expanded to the actual resource they point to;
- JSON pointers and breadcrumbs for every hop;
- missing targets, cycles, duplicates, and unlinked resources.
How to inspect a JSON:API response
- Open the viewer. Go to JSON:API Lens. Nothing needs to be installed and there is no account.
-
Add the document. Paste the response into the editor, drop a
.jsonfile, or use the URL button to fetch an endpoint directly. URL fetching depends on the API's CORS policy. - Expand what matters. Click a relationship to follow it. Use Expand all with a depth limit to open the whole graph. Cycles stop automatically.
- Check the issues. The Issues tab runs structural JSON:API 1.1 checks and links every finding to a JSON pointer.
-
Copy resolved JSON. The
{}button on a resource card produces plain JSON with attributes flattened and relationships inlined — useful for fixtures, tests, and debugging.
Why recursive expansion matters
Most viewers stop after one level: they show the primary resource and its immediate relationships. Real APIs often nest further. A screen points to widgets, widgets point to blocks, blocks point to actions, and actions point to stores. Only the first few levels may be present in the response.
Lens follows the chain as deep as the document allows. When a relationship points to a resource that is
not in data or included, it shows a missing chip with the exact
pointer. That distinction is important: sparse linkage is legal in JSON:API, so a missing target is not
automatically a bug.
Example: following a relationship
{
"data": {
"type": "articles",
"id": "1",
"attributes": { "title": "JSON:API paints my bikeshed!" },
"relationships": {
"author": { "data": { "type": "people", "id": "9" } }
}
},
"included": [
{
"type": "people",
"id": "9",
"attributes": { "name": "Dan Gebhardt" },
"relationships": {
"employer": { "data": { "type": "companies", "id": "1" } }
}
}
]
}
A plain formatter shows you two arrays. Lens shows articles #1 → author → people #9 → employer →
companies #1, with the attributes of each resource in place. If companies:1 were
absent, the employer row would be marked as missing rather than silently disappearing.
What the viewer does not do
Lens is a client-side inspector, not an API client or a schema validator. It checks the structure required by JSON:API 1.1; it cannot know your business rules, required attributes, or authorization model. It also does not modify or send your document anywhere.
Frequently asked questions
What does a JSON:API viewer show?
It shows primary data and included resources as resource cards, resolves relationship linkage to the actual objects, and displays attributes, links, and metadata in a readable structure.
Can a JSON:API viewer expand nested relationships?
JSON:API Lens expands relationships recursively through included resources, at any depth, while detecting cycles and marking targets that are not present in the document.
Does the viewer upload my document?
No. The document is parsed and rendered in your browser. If you fetch a URL, the request goes directly from your browser to that API and is subject to its CORS policy.
Try it with your own response
Free, private, and no signup required.