json-schema-0.7.4.1: Types and type classes for defining JSON schemas.

Safe HaskellNone
LanguageHaskell98

Data.JSON.Schema.Validate

Synopsis

Documentation

isValid :: Schema -> Value -> Bool #

Predicate version of validate.

validate :: Schema -> Value -> Vector ValidationError #

Validates a value against a schema returning errors.

data ValidationError #

Constructors

ValidationError 

Fields

data ErrorType #

Constructors

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).