Safe Haskell | None |
---|---|
Language | Haskell2010 |
JSONSchema.Validator.Draft4.Object
- newtype MaxProperties = MaxProperties {}
- data MaxPropertiesInvalid = MaxPropertiesInvalid MaxProperties (HashMap Text Value)
- maxPropertiesVal :: MaxProperties -> HashMap Text Value -> Maybe MaxPropertiesInvalid
- newtype MinProperties = MinProperties {}
- data MinPropertiesInvalid = MinPropertiesInvalid MinProperties (HashMap Text Value)
- minPropertiesVal :: MinProperties -> HashMap Text Value -> Maybe MinPropertiesInvalid
- newtype Required = Required {
- _unRequired :: Set Text
- data RequiredInvalid = RequiredInvalid Required (Set Text) (HashMap Text Value)
- requiredVal :: Required -> HashMap Text Value -> Maybe RequiredInvalid
- newtype DependenciesValidator schema = DependenciesValidator {
- _unDependenciesValidator :: HashMap Text (Dependency schema)
- data Dependency schema
- = SchemaDependency schema
- | PropertyDependency (Set Text)
- data DependencyMemberInvalid err
- = SchemaDepInvalid (NonEmpty err)
- | PropertyDepInvalid (Set Text) (HashMap Text Value)
- newtype DependenciesInvalid err = DependenciesInvalid (HashMap Text (DependencyMemberInvalid err))
- dependenciesVal :: forall err schema. (schema -> Value -> [err]) -> DependenciesValidator schema -> HashMap Text Value -> Maybe (DependenciesInvalid err)
- data PropertiesRelated schema = PropertiesRelated {
- _propProperties :: Maybe (HashMap Text schema)
- _propPattern :: Maybe (HashMap Text schema)
- _propAdditional :: Maybe (AdditionalProperties schema)
- emptyProperties :: PropertiesRelated schema
- data AdditionalProperties schema
- newtype Regex = Regex {}
- data PropertiesRelatedInvalid err = PropertiesRelatedInvalid {
- _prInvalidProperties :: HashMap Text [err]
- _prInvalidPattern :: HashMap (Regex, Key) [err]
- _prInvalidAdditional :: Maybe (APInvalid err)
- data APInvalid err
- = APBoolInvalid (HashMap Text Value)
- | APObjectInvalid (HashMap Text (NonEmpty err))
- propertiesRelatedVal :: forall err schema. (schema -> Value -> [err]) -> PropertiesRelated schema -> HashMap Text Value -> Maybe (PropertiesRelatedInvalid err)
- newtype Remaining = Remaining {}
- patternAndUnmatched :: forall err schema. (schema -> Value -> [err]) -> HashMap Text schema -> HashMap Text Value -> (HashMap (Regex, Key) [err], Remaining)
- additionalProperties :: forall err schema. (schema -> Value -> [err]) -> AdditionalProperties schema -> Remaining -> Maybe (APInvalid err)
- additionalPropertiesBool :: Bool -> Remaining -> Maybe (HashMap Text Value)
- additionalPropertiesObject :: forall err schema. (schema -> Value -> [err]) -> schema -> Remaining -> Maybe (HashMap Text (NonEmpty err))
maxProperties
data MaxPropertiesInvalid Source #
Constructors
MaxPropertiesInvalid MaxProperties (HashMap Text Value) |
Instances
maxPropertiesVal :: MaxProperties -> HashMap Text Value -> Maybe MaxPropertiesInvalid Source #
The spec requires "maxProperties"
to be non-negative.
minProperties
data MinPropertiesInvalid Source #
Constructors
MinPropertiesInvalid MinProperties (HashMap Text Value) |
Instances
minPropertiesVal :: MinProperties -> HashMap Text Value -> Maybe MinPropertiesInvalid Source #
The spec requires "minProperties"
to be non-negative.
required
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.
Constructors
Required | |
Fields
|
data RequiredInvalid Source #
Instances
requiredVal :: Required -> HashMap Text Value -> Maybe RequiredInvalid Source #
dependencies
newtype DependenciesValidator schema Source #
Constructors
DependenciesValidator | |
Fields
|
Instances
Eq schema => Eq (DependenciesValidator schema) Source # | |
Show schema => Show (DependenciesValidator schema) Source # | |
FromJSON schema => FromJSON (DependenciesValidator schema) Source # | |
data Dependency schema Source #
Constructors
SchemaDependency schema | |
PropertyDependency (Set Text) |
Instances
Eq schema => Eq (Dependency schema) Source # | |
Show schema => Show (Dependency schema) Source # | |
Arbitrary schema => Arbitrary (Dependency schema) Source # | |
ToJSON schema => ToJSON (Dependency schema) Source # | |
FromJSON schema => FromJSON (Dependency schema) Source # | |
data DependencyMemberInvalid err Source #
Constructors
SchemaDepInvalid (NonEmpty err) | |
PropertyDepInvalid (Set Text) (HashMap Text Value) |
Instances
Eq err => Eq (DependencyMemberInvalid err) Source # | |
Show err => Show (DependencyMemberInvalid err) Source # | |
newtype DependenciesInvalid err Source #
Constructors
DependenciesInvalid (HashMap Text (DependencyMemberInvalid err)) |
Instances
Eq err => Eq (DependenciesInvalid err) Source # | |
Show err => Show (DependenciesInvalid err) Source # | |
dependenciesVal :: forall err schema. (schema -> Value -> [err]) -> DependenciesValidator schema -> HashMap Text Value -> Maybe (DependenciesInvalid 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.
data PropertiesRelated schema Source #
Constructors
PropertiesRelated | |
Fields
|
Instances
Eq schema => Eq (PropertiesRelated schema) Source # | |
Show schema => Show (PropertiesRelated schema) Source # | |
FromJSON schema => FromJSON (PropertiesRelated schema) Source # | |
emptyProperties :: PropertiesRelated schema Source #
data AdditionalProperties schema Source #
Constructors
AdditionalPropertiesBool Bool | |
AdditionalPropertiesObject schema |
Instances
Eq schema => Eq (AdditionalProperties schema) Source # | |
Show schema => Show (AdditionalProperties schema) Source # | |
Arbitrary schema => Arbitrary (AdditionalProperties schema) Source # | |
ToJSON schema => ToJSON (AdditionalProperties schema) Source # | |
FromJSON schema => FromJSON (AdditionalProperties schema) Source # | |
A glorified type
alias.
data PropertiesRelatedInvalid err Source #
Constructors
PropertiesRelatedInvalid | |
Fields
|
Instances
Eq err => Eq (PropertiesRelatedInvalid err) Source # | |
Show err => Show (PropertiesRelatedInvalid err) Source # | |
Constructors
APBoolInvalid (HashMap Text Value) | |
APObjectInvalid (HashMap Text (NonEmpty err)) |
propertiesRelatedVal :: forall err schema. (schema -> Value -> [err]) -> PropertiesRelated schema -> HashMap Text Value -> Maybe (PropertiesRelatedInvalid err) Source #
First "properties"
and "patternProperties"
are run simultaneously
on the data, then "additionalProperties"
is run on the remainder.
patternAndUnmatched :: forall err schema. (schema -> Value -> [err]) -> HashMap Text schema -> HashMap Text Value -> (HashMap (Regex, Key) [err], Remaining) Source #
Internal.
additionalProperties :: forall err schema. (schema -> Value -> [err]) -> AdditionalProperties schema -> Remaining -> Maybe (APInvalid err) Source #