hjsonschema-1.6.3: JSON Schema library

Safe HaskellNone
LanguageHaskell2010

JSONSchema.Validator.Draft4

Contents

Description

Turn the validation functions into actual Validators.

This is frankly a lot of busywork. It can perhaps be moved into the validator modules themselves once we're sure this is the right design.

Synopsis

Documentation

run :: FromJSON b => (a -> b -> Maybe c) -> Maybe a -> Value -> [c] Source #

For internal use.

Take a validation function, a possibly existing validator, and some data. If the validator is exists and can validate the type of data we have, attempt to do so and return any failures.

noEmbedded :: a -> ([b], [b]) Source #

For internal use.

Numbers

Strings

Arrays

itemsRelatedValidator :: (schema -> Value -> [err]) -> Validator schema (ItemsRelated schema) (ItemsRelatedInvalid err) Source #

Objects

dependenciesValidator :: (schema -> Value -> [err]) -> Validator schema (Maybe (DependenciesValidator schema)) (DependenciesInvalid err) Source #

newtype Definitions schema Source #

Constructors

Definitions 

Fields

Instances

Eq schema => Eq (Definitions schema) Source # 

Methods

(==) :: Definitions schema -> Definitions schema -> Bool #

(/=) :: Definitions schema -> Definitions schema -> Bool #

Show schema => Show (Definitions schema) Source # 

Methods

showsPrec :: Int -> Definitions schema -> ShowS #

show :: Definitions schema -> String #

showList :: [Definitions schema] -> ShowS #

FromJSON schema => FromJSON (Definitions schema) Source # 

Any

refValidator :: (FromJSON schema, ToJSON schema) => (Text -> Maybe schema) -> (BaseURI -> schema -> BaseURI) -> (VisitedSchemas -> Scope schema -> schema -> Value -> [err]) -> VisitedSchemas -> Scope schema -> Validator a (Maybe Ref) (RefInvalid err) Source #

allOfValidator :: (schema -> Value -> [err]) -> Validator schema (Maybe (AllOf schema)) (AllOfInvalid err) Source #

anyOfValidator :: (schema -> Value -> [err]) -> Validator schema (Maybe (AnyOf schema)) (AnyOfInvalid err) Source #

oneOfValidator :: ToJSON schema => (schema -> Value -> [err]) -> Validator schema (Maybe (OneOf schema)) (OneOfInvalid err) Source #

notValidator :: ToJSON schema => (schema -> Value -> [err]) -> Validator schema (Maybe (NotValidator schema)) NotValidatorInvalid Source #