Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- 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.
data ValidationError Source #
Instances
Eq ValidationError Source # | |
Defined in Data.JSON.Schema.Validate (==) :: ValidationError -> ValidationError -> Bool # (/=) :: ValidationError -> ValidationError -> Bool # | |
Show ValidationError Source # | |
Defined in Data.JSON.Schema.Validate showsPrec :: Int -> ValidationError -> ShowS # show :: ValidationError -> String # showList :: [ValidationError] -> ShowS # |
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). |