Skip to content

TypeScript API / laikacms/json-api / decodeJsonApiResponse

Variable: decodeJsonApiResponse ​

ts
const decodeJsonApiResponse: (input, options?) => object;

Parameters ​

ParameterType
inputunknown
options?ParseOptions

Returns ​

object

data ​

ts
readonly data: object = JsonApiResourceSchema;

data.attributes ​

ts
readonly attributes: object;
Index Signature ​
ts
[key: string]: any

data.id ​

ts
readonly id: string = S.String;
ts
readonly optional links?: object;

Resource-level links per JSON:API spec — at minimum self, optionally related. Lets a client navigate from a collection item to its canonical detail URL without reconstructing the route table.

Index Signature ​
ts
[key: string]: string

data.meta? ​

ts
readonly optional meta?: object;

Per JSON:API spec, resource-level meta is the right home for protocol / backend-specific information that isn't part of the entity's primary attributes — e.g. a storage object's extension + revisionId.

Index Signature ​
ts
[key: string]: any

data.relationships? ​

ts
readonly optional relationships?: object;
Index Signature ​
ts
[key: string]: any

data.type ​

ts
readonly type: string = S.String;
ts
readonly optional links?: object;
ts
readonly optional first?: string;
ts
readonly optional last?: string;
ts
readonly optional next?: string;
ts
readonly optional prev?: string;
ts
readonly optional self?: string;

meta? ​

ts
readonly optional meta?: object;

Index Signature ​

ts
[key: string]: any

Released under the MIT License.