Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype MaxItems = MaxItems {
- _unMaxItems :: Int
- data MaxItemsInvalid = MaxItemsInvalid MaxItems (Vector Value)
- maxItemsVal :: MaxItems -> Vector Value -> Maybe MaxItemsInvalid
- newtype MinItems = MinItems {
- _unMinItems :: Int
- data MinItemsInvalid = MinItemsInvalid MinItems (Vector Value)
- minItemsVal :: MinItems -> Vector Value -> Maybe MinItemsInvalid
- newtype UniqueItems = UniqueItems {}
- newtype UniqueItemsInvalid = UniqueItemsInvalid (Vector Value)
- uniqueItemsVal :: UniqueItems -> Vector Value -> Maybe UniqueItemsInvalid
- data ItemsRelated schema = ItemsRelated {
- _irItems :: Maybe (Items schema)
- _irAdditional :: Maybe (AdditionalItems schema)
- emptyItems :: ItemsRelated schema
- data Items schema
- = ItemsObject schema
- | ItemsArray [schema]
- data ItemsRelatedInvalid err
- = IRInvalidItems (ItemsInvalid err)
- | IRInvalidAdditional (AdditionalItemsInvalid err)
- data ItemsInvalid err
- = ItemsObjectInvalid (NonEmpty (Index, NonEmpty err))
- | ItemsArrayInvalid (NonEmpty (Index, NonEmpty err))
- itemsRelatedVal :: forall err schema. (schema -> Value -> [err]) -> ItemsRelated schema -> Vector Value -> [ItemsRelatedInvalid err]
- itemsVal :: forall err schema. (schema -> Value -> [err]) -> Items schema -> Vector Value -> (Maybe (ItemsInvalid err), [(Index, Value)])
- data AdditionalItems schema
- = AdditionalBool Bool
- | AdditionalObject schema
- data AdditionalItemsInvalid err
- = AdditionalItemsBoolInvalid (NonEmpty (Index, Value))
- | AdditionalItemsObjectInvalid (NonEmpty (Index, NonEmpty err))
- additionalItemsVal :: forall err schema. (schema -> Value -> [err]) -> AdditionalItems schema -> [(Index, Value)] -> Maybe (AdditionalItemsInvalid err)
maxItems
data MaxItemsInvalid Source #
maxItemsVal :: MaxItems -> Vector Value -> Maybe MaxItemsInvalid Source #
The spec requires "maxItems"
to be non-negative.
minItems
data MinItemsInvalid Source #
minItemsVal :: MinItems -> Vector Value -> Maybe MinItemsInvalid Source #
The spec requires "minItems"
to be non-negative.
uniqueItems
newtype UniqueItems Source #
newtype UniqueItemsInvalid Source #
items
data ItemsRelated schema Source #
ItemsRelated | |
|
Eq schema => Eq (ItemsRelated schema) Source # | |
Show schema => Show (ItemsRelated schema) Source # | |
FromJSON schema => FromJSON (ItemsRelated schema) Source # | |
emptyItems :: ItemsRelated schema Source #
ItemsObject schema | |
ItemsArray [schema] |
data ItemsRelatedInvalid err Source #
Eq err => Eq (ItemsRelatedInvalid err) Source # | |
Show err => Show (ItemsRelatedInvalid err) Source # | |
data ItemsInvalid err Source #
ItemsObjectInvalid (NonEmpty (Index, NonEmpty err)) | |
ItemsArrayInvalid (NonEmpty (Index, NonEmpty err)) |
Eq err => Eq (ItemsInvalid err) Source # | |
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.
:: (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 |
Internal.
This is because itemsRelated
handles "items"
validation.
additionalItems
data AdditionalItems schema Source #
AdditionalBool Bool | |
AdditionalObject schema |
Eq schema => Eq (AdditionalItems schema) Source # | |
Show schema => Show (AdditionalItems schema) Source # | |
Arbitrary schema => Arbitrary (AdditionalItems schema) Source # | |
ToJSON schema => ToJSON (AdditionalItems schema) Source # | |
FromJSON schema => FromJSON (AdditionalItems schema) Source # | |
data AdditionalItemsInvalid err Source #
AdditionalItemsBoolInvalid (NonEmpty (Index, Value)) | |
AdditionalItemsObjectInvalid (NonEmpty (Index, NonEmpty err)) |
Eq err => Eq (AdditionalItemsInvalid err) Source # | |
Show err => Show (AdditionalItemsInvalid err) Source # | |
:: (schema -> Value -> [err]) | |
-> AdditionalItems schema | |
-> [(Index, Value)] | The elements remaining to validate after the ones covered by
|
-> Maybe (AdditionalItemsInvalid err) |
Internal.
This is because itemsRelated
handles "additionalItems"
validation.