Safe Haskell | None |
---|---|
Language | Haskell98 |
- isValid :: Schema -> Value -> Bool
- validate :: Schema -> Value -> Vector ValidationError
- data ValidationError = ValidationError {}
- data ErrorType
Documentation
validate :: Schema -> Value -> Vector ValidationError Source
Validates a value against a schema returning errors.
Mismatch Schema Value | General type error. |
BoundError Bound Scientific | Number out of bounds. |
LengthBoundError LengthBound Int | String or Array out of bounds. |
TupleLength Int Int | Expected and actual tuple length. |
MissingRequiredField Text | A required field is missing. |
ChoiceError (Vector (Vector ValidationError)) Value | All choices failed, contains the error of each branch. |
NonUniqueArray (HashMap Value Int) | The elements in the array that are duplicated with the number of occurences (at least 2). |