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

Safe HaskellNone
LanguageHaskell2010

Data.JSON.Schema.Validate

Synopsis

Documentation

isValid :: Schema -> Value -> Bool Source #

Predicate version of validate.

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

Validates a value against a schema returning errors.

data ValidationError Source #

Constructors

ValidationError 

Fields

data ErrorType Source #

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

Instances
Eq ErrorType Source # 
Instance details

Defined in Data.JSON.Schema.Validate

Show ErrorType Source # 
Instance details

Defined in Data.JSON.Schema.Validate