See https://runkit.com/eliothowes1090/hannibal-error-example for example of issue.
Given the following schema:
{
type: 'object',
schema: {
foo: {
type: 'array',
validators: {
max: 2
},
schema: {
type: 'string',
validators: {
enum: [
'fish',
'chips'
]
}
}
}
}
}
And the following data structure:
{
foo: [
'',
'not fish',
'not chips'
]
}
The following error object is returned:
foo: [
{enum: "string: is not one of: fish, chips"},
{enum: "string: not chips is not one of: fish, chips"},
{enum: "string: not chips is not one of: fish, chips"},
max: "array is too long, requires: 2 items and was: 3"
]
See https://runkit.com/eliothowes1090/hannibal-error-example for example of issue.
Given the following schema:
And the following data structure:
The following error object is returned: