This package provides TypeScript type definitions for JSON:API documents, enabling compile-time validation of JSON:API structures within TypeScript projects. The current stable version is 0.1.3, released in April 2019. Given the lack of updates since then, its release cadence is effectively inactive, and it should be considered abandoned. Its primary differentiator is its sole focus on providing type-checking for JSON:API, without including any runtime parsing or serialization logic. This makes it a lightweight option for projects that already handle data fetching and serialization and only require type-safety enforcement against the JSON:API specification.
npm install jsonapi-typescriptVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing the type definitions and validating a basic JSON:API document structure at compile-time.
Consider alternatives like `ts-japi` or `ts-json-api` for actively maintained and up-to-date JSON:API type solutions.
Pair this with a separate JSON:API client or serialization library if runtime operations are needed. Or use a library that combines types with runtime logic.
Manually extend or augment types if specific advanced JSON:API features not covered by this package are required.
Ensure the top-level document contains 'data', 'errors', or 'meta' members as per JSON:API specification.
Ensure that `data` and relationship `data` fields correctly specify `ResourceObject` or `ResourceIdentifierObject` types, or arrays thereof, as defined by JSON:API.
All `ResourceObject` and `ResourceIdentifierObject` types must include both `type` and `id` properties.
No dependency data recorded yet.