Skip to content

TypeScript API / laikacms/json-api / decodeJsonApiResource

Variable: decodeJsonApiResource ​

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

Parameters ​

ParameterType
inputunknown
options?ParseOptions

Returns ​

attributes ​

ts
readonly attributes: object;

Index Signature ​

ts
[key: string]: any

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

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

relationships? ​

ts
readonly optional relationships?: object;

Index Signature ​

ts
[key: string]: any

type ​

ts
readonly type: string = S.String;

Released under the MIT License.