hjsonschema-1.1.0.1: JSON Schema library

Safe HaskellNone
LanguageHaskell2010

Data.Validator.Draft4.Object

Contents

Synopsis

maxProperties

maxProperties :: Int -> HashMap Text Value -> Maybe (Fail ()) Source #

The spec requires "maxProperties" to be non-negative.

minProperties

minProperties :: Int -> HashMap Text Value -> Maybe (Fail ()) Source #

The spec requires "minProperties" to be non-negative.

required

newtype Required Source #

From the spec:

The value of this keyword MUST be an array.
This array MUST have at least one element.
Elements of this array MUST be strings, and MUST be unique.

We don't enfore that Required has at least one element in the haskell code, but we do in the FromJSON instance.

Constructors

Required 

Fields

dependencies

data Dependency schema Source #

Instances

Eq schema => Eq (Dependency schema) Source # 

Methods

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

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

Show schema => Show (Dependency schema) Source # 

Methods

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

show :: Dependency schema -> String #

showList :: [Dependency schema] -> ShowS #

Arbitrary schema => Arbitrary (Dependency schema) Source # 

Methods

arbitrary :: Gen (Dependency schema) #

shrink :: Dependency schema -> [Dependency schema] #

ToJSON schema => ToJSON (Dependency schema) Source # 

Methods

toJSON :: Dependency schema -> Value #

toEncoding :: Dependency schema -> Encoding #

FromJSON schema => FromJSON (Dependency schema) Source # 

Methods

parseJSON :: Value -> Parser (Dependency schema) #

dependencies :: forall err schema. (schema -> Value -> [Fail err]) -> HashMap Text (Dependency schema) -> HashMap Text Value -> [Fail (DependencyInvalid err)] Source #

From the spec: http://json-schema.org/latest/json-schema-validation.html#anchor70

This keyword's value MUST be an object.
Each value of this object MUST be either an object or an array.

If the value is an object, it MUST be a valid JSON Schema.
This is called a schema dependency.

If the value is an array, it MUST have at least one element.
Each element MUST be a string, and elements in the array MUST be unique.
This is called a property dependency.

newtype Remaining Source #

For internal use.

Constructors

Remaining 

properties

properties :: forall err schema. (schema -> Value -> [Fail err]) -> Maybe (HashMap Text schema) -> Maybe (AdditionalProperties schema) -> HashMap Text schema -> HashMap Text Value -> [Fail (PropertiesInvalid err)] Source #

In order of what's tried: "properties", "patternProperties", "additionalProperties".

patternProperties

patternProperties :: forall err schema. (schema -> Value -> [Fail err]) -> Bool -> Maybe (AdditionalProperties schema) -> HashMap Text schema -> HashMap Text Value -> [Fail (PatternPropertiesInvalid err)] Source #

patternAndUnmatched :: forall err schema. (schema -> Value -> [Fail err]) -> HashMap Text schema -> HashMap Text Value -> ([Fail err], Remaining) Source #

additionalProperties

additionalProperties :: forall err schema. (schema -> Value -> [Fail err]) -> Bool -> AdditionalProperties schema -> HashMap Text Value -> [Fail (AdditionalPropertiesInvalid err)] Source #

additionalPropertiesObject :: forall err schema. (schema -> Value -> [Fail err]) -> schema -> HashMap Text Value -> [Fail err] Source #