JSON:API to TypeScript

Paste any JSON:API document — single resource, collection, or compound document with included — and get TypeScript interfaces for data, attributes, relationships, and links.

JSON input valid
TypeScript output

      
    

About this conversion

JSON:API (jsonapi.org) imposes a strict envelope: every resource has a type, an id, an attributes bag, an optional relationships bag, and optional links. Compound documents add a top-level included array carrying related resources. Hand-typing this in TypeScript is tedious, especially when the attributes shape varies by resource type. Pasting a real document — pulled from your API or from your fixture file — generates accurate interfaces in one paste.

The result lets you narrow on data.type, type-safely access attributes, and walk relationships into the included array. For applications consuming Ember Data, JSON:API-compliant Rails APIs, or Laravel JSON:API, this is the fastest way to bootstrap a typed client without committing to a heavyweight code-generation pipeline.

Same shape, other validators

Other JSON shapes