hjsonschema-1.6.3: JSON Schema library

Safe HaskellNone
LanguageHaskell2010

JSONSchema.Validator.Draft4.Array

Contents

Synopsis

maxItems

maxItemsVal :: MaxItems -> Vector Value -> Maybe MaxItemsInvalid Source #

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

minItems

minItemsVal :: MinItems -> Vector Value -> Maybe MinItemsInvalid Source #

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

uniqueItems

items

data ItemsRelated schema Source #

Constructors

ItemsRelated 

Fields

Instances

Eq schema => Eq (ItemsRelated schema) Source # 

Methods

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

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

Show schema => Show (ItemsRelated schema) Source # 

Methods

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

show :: ItemsRelated schema -> String #

showList :: [ItemsRelated schema] -> ShowS #

FromJSON schema => FromJSON (ItemsRelated schema) Source # 

data Items schema Source #

Constructors

ItemsObject schema 
ItemsArray [schema] 

Instances

Eq schema => Eq (Items schema) Source # 

Methods

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

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

Show schema => Show (Items schema) Source # 

Methods

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

show :: Items schema -> String #

showList :: [Items schema] -> ShowS #

Arbitrary schema => Arbitrary (Items schema) Source # 

Methods

arbitrary :: Gen (Items schema) #

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

ToJSON schema => ToJSON (Items schema) Source # 

Methods

toJSON :: Items schema -> Value #

toEncoding :: Items schema -> Encoding #

toJSONList :: [Items schema] -> Value #

toEncodingList :: [Items schema] -> Encoding #

FromJSON schema => FromJSON (Items schema) Source # 

Methods

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

parseJSONList :: Value -> Parser [Items schema] #

data ItemsInvalid err Source #

Instances

Eq err => Eq (ItemsInvalid err) Source # 

Methods

(==) :: ItemsInvalid err -> ItemsInvalid err -> Bool #

(/=) :: ItemsInvalid err -> ItemsInvalid err -> Bool #

Show err => Show (ItemsInvalid err) Source # 

itemsRelatedVal :: forall err schema. (schema -> Value -> [err]) -> ItemsRelated schema -> Vector Value -> [ItemsRelatedInvalid err] Source #

"additionalItems" only matters if "items" exists and is a JSON Array.

itemsVal Source #

Arguments

:: (schema -> Value -> [err]) 
-> Items schema 
-> Vector Value 
-> (Maybe (ItemsInvalid err), [(Index, Value)])

The second item in the tuple is the elements of the original JSON Array still remaining to be checked by "additionalItems".

Internal.

This is because itemsRelated handles "items" validation.

additionalItems

data AdditionalItems schema Source #

Constructors

AdditionalBool Bool 
AdditionalObject schema 

Instances

Eq schema => Eq (AdditionalItems schema) Source # 

Methods

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

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

Show schema => Show (AdditionalItems schema) Source # 

Methods

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

show :: AdditionalItems schema -> String #

showList :: [AdditionalItems schema] -> ShowS #

Arbitrary schema => Arbitrary (AdditionalItems schema) Source # 

Methods

arbitrary :: Gen (AdditionalItems schema) #

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

ToJSON schema => ToJSON (AdditionalItems schema) Source # 
FromJSON schema => FromJSON (AdditionalItems schema) Source # 

additionalItemsVal Source #

Arguments

:: (schema -> Value -> [err]) 
-> AdditionalItems schema 
-> [(Index, Value)]

The elements remaining to validate after the ones covered by "items" have been removed.

-> Maybe (AdditionalItemsInvalid err) 

Internal.

This is because itemsRelated handles "additionalItems" validation.