Skip to content

TypeScript API / laikacms/json-api / schemaIssueFormatter

Function: schemaIssueFormatter() ​

ts
function schemaIssueFormatter(issue): object;

Convert a schema parse error issue to a JSON:API error response

Parameters ​

ParameterTypeDescription
issue{ message: string; path: readonly (string | number)[]; }The parse error issue to convert
issue.messagestring-
issue.pathreadonly (string | number)[]-

Returns ​

object

JSON:API error object

code ​

ts
readonly code: string = S.String;

detail ​

ts
readonly detail: string = S.String;

source? ​

ts
readonly optional source?: object;

source.parameter? ​

ts
readonly optional parameter?: string;

source.pointer? ​

ts
readonly optional pointer?: string;

status ​

ts
readonly status: string = S.String;

title ​

ts
readonly title: string = S.String;

Released under the MIT License.