-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | JSON Schema library
--   
--   JSON Schema library
@package hjsonschema
@version 1.7.2

module JSONSchema.Validator.Draft4.Number
newtype MultipleOf
MultipleOf :: Scientific -> MultipleOf
[_unMultipleOf] :: MultipleOf -> Scientific
data MultipleOfInvalid
MultipleOfInvalid :: MultipleOf -> Scientific -> MultipleOfInvalid

-- | The spec requires <tt>"multipleOf"</tt> to be positive.
multipleOfVal :: MultipleOf -> Scientific -> Maybe MultipleOfInvalid
data Maximum
Maximum :: Bool -> Scientific -> Maximum
[_maximumExclusive] :: Maximum -> Bool
[_maximumValue] :: Maximum -> Scientific
data MaximumInvalid
MaximumInvalid :: Maximum -> Scientific -> MaximumInvalid
maximumVal :: Maximum -> Scientific -> Maybe MaximumInvalid
data Minimum
Minimum :: Bool -> Scientific -> Minimum
[_minimumExclusive] :: Minimum -> Bool
[_minimumValue] :: Minimum -> Scientific
data MinimumInvalid
MinimumInvalid :: Minimum -> Scientific -> MinimumInvalid
minimumVal :: Minimum -> Scientific -> Maybe MinimumInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Number.MinimumInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Number.MinimumInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Number.Minimum
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Number.Minimum
instance GHC.Show.Show JSONSchema.Validator.Draft4.Number.MaximumInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Number.MaximumInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Number.Maximum
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Number.Maximum
instance GHC.Show.Show JSONSchema.Validator.Draft4.Number.MultipleOfInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Number.MultipleOfInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Number.MultipleOf
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Number.MultipleOf
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Number.Minimum
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Number.Maximum
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Number.MultipleOf

module JSONSchema.Validator.Draft4.String
newtype MaxLength
MaxLength :: Int -> MaxLength
[_unMaxLength] :: MaxLength -> Int
data MaxLengthInvalid
MaxLengthInvalid :: MaxLength -> Text -> MaxLengthInvalid

-- | The spec requires <tt>"maxLength"</tt> to be non-negative.
maxLengthVal :: MaxLength -> Text -> Maybe MaxLengthInvalid
newtype MinLength
MinLength :: Int -> MinLength
[_unMinLength] :: MinLength -> Int
data MinLengthInvalid
MinLengthInvalid :: MinLength -> Text -> MinLengthInvalid

-- | The spec requires <tt>"minLength"</tt> to be non-negative.
minLengthVal :: MinLength -> Text -> Maybe MinLengthInvalid
newtype PatternValidator
PatternValidator :: Text -> PatternValidator
[_unPatternValidator] :: PatternValidator -> Text
data PatternInvalid
PatternNotRegex :: PatternInvalid
PatternInvalid :: PatternValidator -> Text -> PatternInvalid
patternVal :: PatternValidator -> Text -> Maybe PatternInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.String.PatternInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.String.PatternInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.String.PatternValidator
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.String.PatternValidator
instance GHC.Show.Show JSONSchema.Validator.Draft4.String.MinLengthInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.String.MinLengthInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.String.MinLength
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.String.MinLength
instance GHC.Show.Show JSONSchema.Validator.Draft4.String.MaxLengthInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.String.MaxLengthInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.String.MaxLength
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.String.MaxLength
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.String.PatternValidator
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.String.MinLength
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.String.MaxLength


-- | JSON Reference is described here:
--   <a>http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03</a>
--   
--   And is extended for JSON Schema here:
--   <a>http://json-schema.org/latest/json-schema-core.html#anchor26</a>
module JSONSchema.Validator.Reference
data Scope schema
Scope :: schema -> Maybe Text -> BaseURI -> Scope schema
[_topLevelDocument] :: Scope schema -> schema
[_documentURI] :: Scope schema -> Maybe Text
[_currentBaseURI] :: Scope schema -> BaseURI
newtype BaseURI
BaseURI :: Maybe Text -> BaseURI
[_unBaseURI] :: BaseURI -> Maybe Text

-- | TODO: no `type`s.
type URIAndFragment = (Maybe Text, Maybe Text)
updateResolutionScope :: BaseURI -> Maybe Text -> BaseURI
resolveReference :: BaseURI -> Text -> URIAndFragment
isRemoteReference :: Text -> Bool
baseAndFragment :: Text -> URIAndFragment
resolveScopeAgainst :: BaseURI -> Text -> Text
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Reference.Scope schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Reference.Scope schema)
instance GHC.Show.Show JSONSchema.Validator.Reference.BaseURI
instance GHC.Classes.Eq JSONSchema.Validator.Reference.BaseURI

module JSONSchema.Fetch

-- | This is all the fetching functions need to know about a particular
--   JSON Schema draft, e.g. JSON Schema Draft 4.
data FetchInfo schema
FetchInfo :: (schema -> ([schema], [schema])) -> (schema -> Maybe Text) -> (schema -> Maybe Text) -> FetchInfo schema
[_fiEmbedded] :: FetchInfo schema -> schema -> ([schema], [schema])
[_fiId] :: FetchInfo schema -> schema -> Maybe Text
[_fiRef] :: FetchInfo schema -> schema -> Maybe Text

-- | Keys are URIs (without URI fragments).
newtype URISchemaMap schema
URISchemaMap :: HashMap Text schema -> URISchemaMap schema
[_unURISchemaMap] :: URISchemaMap schema -> HashMap Text schema

-- | A top-level schema along with its location.
data SchemaWithURI schema
SchemaWithURI :: !schema -> !(Maybe Text) -> SchemaWithURI schema
[_swSchema] :: SchemaWithURI schema -> !schema

-- | This is the URI from which the document was originally fetched. It's
--   different than the schema's "id" field, which controls scope when
--   resolving references contained in the schema.
[_swURI] :: SchemaWithURI schema -> !(Maybe Text)
getReference :: URISchemaMap schema -> Text -> Maybe schema
data HTTPFailure
HTTPParseFailure :: Text -> HTTPFailure
HTTPRequestFailure :: HttpException -> HTTPFailure

-- | Take a schema. Retrieve every document either it or its subschemas
--   include via the "$ref" keyword.
referencesViaHTTP' :: forall schema. FromJSON schema => FetchInfo schema -> SchemaWithURI schema -> IO (Either HTTPFailure (URISchemaMap schema))
data FilesystemFailure
FSParseFailure :: Text -> FilesystemFailure
FSReadFailure :: IOException -> FilesystemFailure
referencesViaFilesystem' :: forall schema. FromJSON schema => FetchInfo schema -> SchemaWithURI schema -> IO (Either FilesystemFailure (URISchemaMap schema))

-- | A version of <tt>fetchReferencedSchema</tt>s where the function to
--   fetch schemas is provided by the user. This allows restrictions to be
--   added, e.g. rejecting non-local URIs.
referencesMethodAgnostic :: forall schema. FromJSON schema => (Text -> IO ByteString) -> FetchInfo schema -> SchemaWithURI schema -> IO (Either Text (URISchemaMap schema))
getRecursiveReferences :: forall schema. FromJSON schema => (Text -> IO ByteString) -> FetchInfo schema -> URISchemaMap schema -> SchemaWithURI schema -> IO (Either Text (URISchemaMap schema))

-- | Return the schema passed in as an argument, as well as every subschema
--   contained within it.
includeSubschemas :: forall schema. FetchInfo schema -> SchemaWithURI schema -> [SchemaWithURI schema]
instance GHC.Classes.Eq JSONSchema.Fetch.FilesystemFailure
instance GHC.Show.Show JSONSchema.Fetch.FilesystemFailure
instance GHC.Show.Show JSONSchema.Fetch.HTTPFailure
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Fetch.SchemaWithURI schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Fetch.SchemaWithURI schema)
instance GHC.Base.Monoid (JSONSchema.Fetch.URISchemaMap schema)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Fetch.URISchemaMap schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Fetch.URISchemaMap schema)

module JSONSchema.Validator.Types
data Validator schema val err
Validator :: (val -> ([schema], [schema])) -> (val -> Value -> [err]) -> Validator schema val err

-- | The first list is embedded schemas that validate the same piece of
--   data this schema validates (such as schemas embedded in
--   <tt>allOf</tt>). The second is embedded schemas that validate a subset
--   of that data (such as the schemas embedded in <tt>items</tt>).
--   
--   This is done to allow static detection of loops, though this isn't
--   implemented yet (though the Draft4 code does do live loop detection
--   during validation).
[_embedded] :: Validator schema val err -> val -> ([schema], [schema])
[_validate] :: Validator schema val err -> val -> Value -> [err]
instance GHC.Base.Functor (JSONSchema.Validator.Types.Validator schema val)
instance Data.Profunctor.Unsafe.Profunctor (JSONSchema.Validator.Types.Validator schema)

module JSONSchema.Types
newtype Spec schema err
Spec :: [Validator schema schema err] -> Spec schema err
[_unSpec] :: Spec schema err -> [Validator schema schema err]

-- | Return a schema's immediate subschemas.
--   
--   The first list is subschemas validating the same level of the
--   document, the second list is subschemas validating lower levels (see
--   <a>Fail</a> for a full explanation).
embedded :: Spec schema a -> schema -> ([schema], [schema])
validate :: Spec schema err -> schema -> Value -> [err]

-- | A basic schema type that doesn't impose much structure.
--   
--   <a>Draft4</a> doesn't use this, but instead uses the record based one
--   defined in <a>Schema</a> to make it easier to write draft 4 schemas in
--   Haskell.
newtype Schema
Schema :: HashMap Text Value -> Schema
[_unSchema] :: Schema -> HashMap Text Value
instance Data.Aeson.Types.ToJSON.ToJSON JSONSchema.Types.Schema
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Types.Schema
instance GHC.Show.Show JSONSchema.Types.Schema
instance GHC.Classes.Eq JSONSchema.Types.Schema

module JSONSchema.Validator.Utils
arbitraryText :: Gen Text
arbitraryScientific :: Gen Scientific
arbitraryPositiveScientific :: Gen Scientific
newtype ArbitraryValue
ArbitraryValue :: Value -> ArbitraryValue
[_unArbitraryValue] :: ArbitraryValue -> Value
arbitraryHashMap :: Arbitrary a => Gen (HashMap Text a)
arbitrarySetOfText :: Gen (Set Text)
newtype NonEmpty' a
NonEmpty' :: NonEmpty a -> NonEmpty' a
[_unNonEmpty'] :: NonEmpty' a -> NonEmpty a
allUniqueValues :: (Foldable f, Functor f) => f Value -> Bool
allUnique :: (Foldable f, Ord a) => f a -> Bool

-- | OrdValue's Ord instance needs benchmarking, but it allows us to use
--   our <a>allUnique</a> function instead of O(n^2) nub, so it's probably
--   worth it.
newtype OrdValue
OrdValue :: Value -> OrdValue
[_unOrdValue] :: OrdValue -> Value
instance GHC.Classes.Eq JSONSchema.Validator.Utils.OrdValue
instance GHC.Show.Show JSONSchema.Validator.Utils.ArbitraryValue
instance GHC.Classes.Eq JSONSchema.Validator.Utils.ArbitraryValue
instance GHC.Classes.Ord JSONSchema.Validator.Utils.OrdValue
instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Utils.NonEmpty' a)
instance Data.Aeson.Types.ToJSON.ToJSON a => Data.Aeson.Types.ToJSON.ToJSON (JSONSchema.Validator.Utils.NonEmpty' a)
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (JSONSchema.Validator.Utils.NonEmpty' a)
instance Test.QuickCheck.Arbitrary.Arbitrary JSONSchema.Validator.Utils.ArbitraryValue

module JSONSchema.Validator.Draft4.Object
newtype MaxProperties
MaxProperties :: Int -> MaxProperties
[_unMaxProperties] :: MaxProperties -> Int
data MaxPropertiesInvalid
MaxPropertiesInvalid :: MaxProperties -> (HashMap Text Value) -> MaxPropertiesInvalid

-- | The spec requires <tt>"maxProperties"</tt> to be non-negative.
maxPropertiesVal :: MaxProperties -> HashMap Text Value -> Maybe MaxPropertiesInvalid
newtype MinProperties
MinProperties :: Int -> MinProperties
[_unMinProperties] :: MinProperties -> Int
data MinPropertiesInvalid
MinPropertiesInvalid :: MinProperties -> (HashMap Text Value) -> MinPropertiesInvalid

-- | The spec requires <tt>"minProperties"</tt> to be non-negative.
minPropertiesVal :: MinProperties -> HashMap Text Value -> Maybe MinPropertiesInvalid

-- | From the spec:
--   
--   <pre>
--   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.
--   </pre>
newtype Required
Required :: Set Text -> Required
[_unRequired] :: Required -> Set Text
data RequiredInvalid
RequiredInvalid :: Required -> (Set Text) -> (HashMap Text Value) -> RequiredInvalid
requiredVal :: Required -> HashMap Text Value -> Maybe RequiredInvalid
newtype DependenciesValidator schema
DependenciesValidator :: HashMap Text (Dependency schema) -> DependenciesValidator schema
[_unDependenciesValidator] :: DependenciesValidator schema -> HashMap Text (Dependency schema)
data Dependency schema
SchemaDependency :: schema -> Dependency schema
PropertyDependency :: (Set Text) -> Dependency schema
data DependencyMemberInvalid err
SchemaDepInvalid :: (NonEmpty err) -> DependencyMemberInvalid err
PropertyDepInvalid :: (Set Text) -> (HashMap Text Value) -> DependencyMemberInvalid err
newtype DependenciesInvalid err
DependenciesInvalid :: (HashMap Text (DependencyMemberInvalid err)) -> DependenciesInvalid err

-- | From the spec:
--   <a>http://json-schema.org/latest/json-schema-validation.html#anchor70</a>
--   
--   <pre>
--   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.
--   </pre>
dependenciesVal :: forall err schema. (schema -> Value -> [err]) -> DependenciesValidator schema -> HashMap Text Value -> Maybe (DependenciesInvalid err)
data PropertiesRelated schema
PropertiesRelated :: Maybe (HashMap Text schema) -> Maybe (HashMap Text schema) -> Maybe (AdditionalProperties schema) -> PropertiesRelated schema

-- | <a>Maybe</a> is used to distinguish whether the key is present or not.
[_propProperties] :: PropertiesRelated schema -> Maybe (HashMap Text schema)
[_propPattern] :: PropertiesRelated schema -> Maybe (HashMap Text schema)
[_propAdditional] :: PropertiesRelated schema -> Maybe (AdditionalProperties schema)
emptyProperties :: PropertiesRelated schema
data AdditionalProperties schema
AdditionalPropertiesBool :: Bool -> AdditionalProperties schema
AdditionalPropertiesObject :: schema -> AdditionalProperties schema

-- | A glorified <tt>type</tt> alias.
newtype Regex
Regex :: Text -> Regex
[_unRegex] :: Regex -> Text
data PropertiesRelatedInvalid err
PropertiesRelatedInvalid :: HashMap Text [err] -> HashMap (Regex, Key) [err] -> Maybe (APInvalid err) -> PropertiesRelatedInvalid err
[_prInvalidProperties] :: PropertiesRelatedInvalid err -> HashMap Text [err]
[_prInvalidPattern] :: PropertiesRelatedInvalid err -> HashMap (Regex, Key) [err]
[_prInvalidAdditional] :: PropertiesRelatedInvalid err -> Maybe (APInvalid err)
data APInvalid err
APBoolInvalid :: (HashMap Text Value) -> APInvalid err
APObjectInvalid :: (HashMap Text (NonEmpty err)) -> APInvalid err

-- | First <tt>"properties"</tt> and <tt>"patternProperties"</tt> are run
--   simultaneously on the data, then <tt>"additionalProperties"</tt> is
--   run on the remainder.
propertiesRelatedVal :: forall err schema. (schema -> Value -> [err]) -> PropertiesRelated schema -> HashMap Text Value -> Maybe (PropertiesRelatedInvalid err)

-- | Internal.
newtype Remaining
Remaining :: HashMap Text Value -> Remaining
[_unRemaining] :: Remaining -> HashMap Text Value

-- | Internal.
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)

-- | Internal.
additionalPropertiesBool :: Bool -> Remaining -> Maybe (HashMap Text Value)

-- | Internal.
additionalPropertiesObject :: forall err schema. (schema -> Value -> [err]) -> schema -> Remaining -> Maybe (HashMap Text (NonEmpty err))
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Object.DependenciesInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Object.DependenciesInvalid err)
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Object.DependencyMemberInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Object.DependencyMemberInvalid err)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Object.DependenciesValidator schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Object.DependenciesValidator schema)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Object.Dependency schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Object.Dependency schema)
instance GHC.Show.Show JSONSchema.Validator.Draft4.Object.RequiredInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Object.RequiredInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Object.Required
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Object.Required
instance GHC.Show.Show JSONSchema.Validator.Draft4.Object.MinPropertiesInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Object.MinPropertiesInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Object.MinProperties
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Object.MinProperties
instance GHC.Show.Show JSONSchema.Validator.Draft4.Object.MaxPropertiesInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Object.MaxPropertiesInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Object.MaxProperties
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Object.MaxProperties
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Object.DependenciesValidator schema)
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Object.Dependency schema)
instance Data.Aeson.Types.ToJSON.ToJSON schema => Data.Aeson.Types.ToJSON.ToJSON (JSONSchema.Validator.Draft4.Object.Dependency schema)
instance Test.QuickCheck.Arbitrary.Arbitrary schema => Test.QuickCheck.Arbitrary.Arbitrary (JSONSchema.Validator.Draft4.Object.Dependency schema)
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Object.Required
instance Test.QuickCheck.Arbitrary.Arbitrary JSONSchema.Validator.Draft4.Object.Required
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Object.MinProperties
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Object.MaxProperties

module JSONSchema.Validator.Draft4.Array
newtype MaxItems
MaxItems :: Int -> MaxItems
[_unMaxItems] :: MaxItems -> Int
data MaxItemsInvalid
MaxItemsInvalid :: MaxItems -> (Vector Value) -> MaxItemsInvalid

-- | The spec requires <tt>"maxItems"</tt> to be non-negative.
maxItemsVal :: MaxItems -> Vector Value -> Maybe MaxItemsInvalid
newtype MinItems
MinItems :: Int -> MinItems
[_unMinItems] :: MinItems -> Int
data MinItemsInvalid
MinItemsInvalid :: MinItems -> (Vector Value) -> MinItemsInvalid

-- | The spec requires <tt>"minItems"</tt> to be non-negative.
minItemsVal :: MinItems -> Vector Value -> Maybe MinItemsInvalid
newtype UniqueItems
UniqueItems :: Bool -> UniqueItems
[_unUniqueItems] :: UniqueItems -> Bool
newtype UniqueItemsInvalid
UniqueItemsInvalid :: (Vector Value) -> UniqueItemsInvalid
uniqueItemsVal :: UniqueItems -> Vector Value -> Maybe UniqueItemsInvalid
data ItemsRelated schema
ItemsRelated :: Maybe (Items schema) -> Maybe (AdditionalItems schema) -> ItemsRelated schema
[_irItems] :: ItemsRelated schema -> Maybe (Items schema)
[_irAdditional] :: ItemsRelated schema -> Maybe (AdditionalItems schema)
emptyItems :: ItemsRelated schema
data Items schema
ItemsObject :: schema -> Items schema
ItemsArray :: [schema] -> Items schema
data ItemsRelatedInvalid err
IRInvalidItems :: (ItemsInvalid err) -> ItemsRelatedInvalid err
IRInvalidAdditional :: (AdditionalItemsInvalid err) -> ItemsRelatedInvalid err
data ItemsInvalid err
ItemsObjectInvalid :: (NonEmpty (Index, NonEmpty err)) -> ItemsInvalid err
ItemsArrayInvalid :: (NonEmpty (Index, NonEmpty err)) -> ItemsInvalid err

-- | <tt>"additionalItems"</tt> only matters if <tt>"items"</tt> exists and
--   is a JSON Array.
itemsRelatedVal :: forall err schema. (schema -> Value -> [err]) -> ItemsRelated schema -> Vector Value -> [ItemsRelatedInvalid err]

-- | Internal.
--   
--   This is because <tt>itemsRelated</tt> handles <tt>"items"</tt>
--   validation.
itemsVal :: forall err schema. (schema -> Value -> [err]) -> Items schema -> Vector Value -> (Maybe (ItemsInvalid err), [(Index, Value)])
data AdditionalItems schema
AdditionalBool :: Bool -> AdditionalItems schema
AdditionalObject :: schema -> AdditionalItems schema
data AdditionalItemsInvalid err
AdditionalItemsBoolInvalid :: (NonEmpty (Index, Value)) -> AdditionalItemsInvalid err
AdditionalItemsObjectInvalid :: (NonEmpty (Index, NonEmpty err)) -> AdditionalItemsInvalid err

-- | Internal.
--   
--   This is because <tt>itemsRelated</tt> handles
--   <tt>"additionalItems"</tt> validation.
additionalItemsVal :: forall err schema. (schema -> Value -> [err]) -> AdditionalItems schema -> [(Index, Value)] -> Maybe (AdditionalItemsInvalid err)
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Array.ItemsRelatedInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Array.ItemsRelatedInvalid err)
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Array.AdditionalItemsInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Array.AdditionalItemsInvalid err)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Array.ItemsRelated schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Array.ItemsRelated schema)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Array.AdditionalItems schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Array.AdditionalItems schema)
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Array.ItemsInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Array.ItemsInvalid err)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Array.Items schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Array.Items schema)
instance GHC.Show.Show JSONSchema.Validator.Draft4.Array.UniqueItemsInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Array.UniqueItemsInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Array.UniqueItems
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Array.UniqueItems
instance GHC.Show.Show JSONSchema.Validator.Draft4.Array.MinItemsInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Array.MinItemsInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Array.MinItems
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Array.MinItems
instance GHC.Show.Show JSONSchema.Validator.Draft4.Array.MaxItemsInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Array.MaxItemsInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Array.MaxItems
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Array.MaxItems
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Array.ItemsRelated schema)
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Array.AdditionalItems schema)
instance Data.Aeson.Types.ToJSON.ToJSON schema => Data.Aeson.Types.ToJSON.ToJSON (JSONSchema.Validator.Draft4.Array.AdditionalItems schema)
instance Test.QuickCheck.Arbitrary.Arbitrary schema => Test.QuickCheck.Arbitrary.Arbitrary (JSONSchema.Validator.Draft4.Array.AdditionalItems schema)
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Array.Items schema)
instance Data.Aeson.Types.ToJSON.ToJSON schema => Data.Aeson.Types.ToJSON.ToJSON (JSONSchema.Validator.Draft4.Array.Items schema)
instance Test.QuickCheck.Arbitrary.Arbitrary schema => Test.QuickCheck.Arbitrary.Arbitrary (JSONSchema.Validator.Draft4.Array.Items schema)
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Array.UniqueItems
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Array.MinItems
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Array.MaxItems

module JSONSchema.Validator.Draft4.Any
newtype Ref
Ref :: Text -> Ref
[_unRef] :: Ref -> Text
data RefInvalid err

-- | Indicates a reference that failed to resolve.
--   
--   NOTE: The language agnostic test suite doesn't specify if this should
--   cause a validation error or should allow data to pass. We choose to
--   return a validation error.
--   
--   Also note that ideally we would enforce in the type system that any
--   failing references be dealt with before valididation. Then this could
--   be removed entirely.
RefResolution :: Text -> RefInvalid err
RefPointerResolution :: JSONPointerError -> RefInvalid err
RefLoop :: Text -> VisitedSchemas -> URIAndFragment -> RefInvalid err

-- | <a>Text</a> is the URI and <a>Value</a> is the linked schema.
RefInvalid :: Text -> Value -> (NonEmpty err) -> RefInvalid err
newtype VisitedSchemas
VisitedSchemas :: [URIAndFragment] -> VisitedSchemas
[_unVisited] :: VisitedSchemas -> [URIAndFragment]
refVal :: forall err schema. (FromJSON schema, ToJSON schema) => (Text -> Maybe schema) -> (BaseURI -> schema -> BaseURI) -> (VisitedSchemas -> Scope schema -> schema -> Value -> [err]) -> VisitedSchemas -> Scope schema -> Ref -> Value -> Maybe (RefInvalid err)
getDocument :: forall schema. (Text -> Maybe schema) -> (BaseURI -> schema -> BaseURI) -> Scope schema -> Maybe Text -> Text -> Either Text (Scope schema, schema)
data JSONPointerError

-- | Aspirationally internal.
URLDecodingError :: UnicodeException -> JSONPointerError
FormatError :: FormatError -> JSONPointerError
ResolutionError :: ResolutionError -> JSONPointerError

-- | Aspirationally internal.
SubschemaDecodingError :: Text -> JSONPointerError
resolveFragment :: forall schema. (FromJSON schema, ToJSON schema) => (BaseURI -> schema -> BaseURI) -> Scope schema -> Text -> Either JSONPointerError (Scope schema, schema)

-- | From the spec:
--   <a>http://json-schema.org/latest/json-schema-validation.html#anchor76</a>
--   
--   <pre>
--   The value of this keyword MUST be an array.
--   This array MUST have at least one element.
--   Elements in the array MUST be unique.
--   </pre>
--   
--   NOTE: We don't enforce the uniqueness constraint in the haskell code,
--   but we do in the <a>FromJSON</a> instance.
newtype EnumValidator
EnumValidator :: NonEmpty Value -> EnumValidator
[_unEnumValidator] :: EnumValidator -> NonEmpty Value
data EnumInvalid
EnumInvalid :: EnumValidator -> Value -> EnumInvalid
enumVal :: EnumValidator -> Value -> Maybe EnumInvalid

-- | This is separate from <a>TypeValidator</a> so that
--   <a>TypeValidator</a> can be used to write <a>Schema</a> without
--   messing up the <a>FromJSON</a> instance of that data type.
newtype TypeContext
TypeContext :: TypeValidator -> TypeContext
[_unTypeContext] :: TypeContext -> TypeValidator
data TypeValidator
TypeValidatorString :: SchemaType -> TypeValidator
TypeValidatorArray :: (Set SchemaType) -> TypeValidator
data SchemaType
SchemaObject :: SchemaType
SchemaArray :: SchemaType
SchemaString :: SchemaType
SchemaNumber :: SchemaType
SchemaInteger :: SchemaType
SchemaBoolean :: SchemaType
SchemaNull :: SchemaType
data TypeValidatorInvalid
TypeValidatorInvalid :: TypeValidator -> Value -> TypeValidatorInvalid
typeVal :: TypeContext -> Value -> Maybe TypeValidatorInvalid

-- | Internal.
setFromTypeValidator :: TypeValidator -> Set SchemaType
newtype AllOf schema
AllOf :: NonEmpty schema -> AllOf schema
[_unAllOf] :: AllOf schema -> NonEmpty schema
newtype AllOfInvalid err
AllOfInvalid :: (NonEmpty (Index, NonEmpty err)) -> AllOfInvalid err
allOfVal :: forall err schema. (schema -> Value -> [err]) -> AllOf schema -> Value -> Maybe (AllOfInvalid err)
newtype AnyOf schema
AnyOf :: NonEmpty schema -> AnyOf schema
[_unAnyOf] :: AnyOf schema -> NonEmpty schema
newtype AnyOfInvalid err
AnyOfInvalid :: (NonEmpty (Index, NonEmpty err)) -> AnyOfInvalid err
anyOfVal :: forall err schema. (schema -> Value -> [err]) -> AnyOf schema -> Value -> Maybe (AnyOfInvalid err)
newtype OneOf schema
OneOf :: NonEmpty schema -> OneOf schema
[_unOneOf] :: OneOf schema -> NonEmpty schema
data OneOfInvalid err

-- | The NonEmpty lists contains tuples whose contents are the index of a
--   schema that validated the data and the contents of that schema.
TooManySuccesses :: (NonEmpty (Index, Value)) -> Value -> OneOfInvalid err

-- | The NonEmpty lists contains tuples whose contents are the index of a
--   schema that failed to validate the data and the failures it produced.
NoSuccesses :: (NonEmpty (Index, NonEmpty err)) -> Value -> OneOfInvalid err
oneOfVal :: forall err schema. ToJSON schema => (schema -> Value -> [err]) -> OneOf schema -> Value -> Maybe (OneOfInvalid err)
newtype NotValidator schema
NotValidator :: schema -> NotValidator schema
[_unNotValidator] :: NotValidator schema -> schema
data NotValidatorInvalid
NotValidatorInvalid :: Value -> Value -> NotValidatorInvalid
notVal :: ToJSON schema => (schema -> Value -> [err]) -> NotValidator schema -> Value -> Maybe NotValidatorInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.NotValidatorInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.NotValidatorInvalid
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Any.NotValidator schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Any.NotValidator schema)
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Any.OneOfInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Any.OneOfInvalid err)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Any.OneOf schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Any.OneOf schema)
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Any.AnyOfInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Any.AnyOfInvalid err)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Any.AnyOf schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Any.AnyOf schema)
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Any.AllOfInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Any.AllOfInvalid err)
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Any.AllOf schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Any.AllOf schema)
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.TypeValidatorInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.TypeValidatorInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.TypeContext
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.TypeContext
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.TypeValidator
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.TypeValidator
instance GHC.Generics.Generic JSONSchema.Validator.Draft4.Any.SchemaType
instance GHC.Enum.Enum JSONSchema.Validator.Draft4.Any.SchemaType
instance GHC.Enum.Bounded JSONSchema.Validator.Draft4.Any.SchemaType
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.SchemaType
instance GHC.Classes.Ord JSONSchema.Validator.Draft4.Any.SchemaType
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.SchemaType
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.EnumInvalid
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.EnumInvalid
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.EnumValidator
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.EnumValidator
instance GHC.Show.Show err => GHC.Show.Show (JSONSchema.Validator.Draft4.Any.RefInvalid err)
instance GHC.Classes.Eq err => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Any.RefInvalid err)
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.JSONPointerError
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.JSONPointerError
instance GHC.Base.Monoid JSONSchema.Validator.Draft4.Any.VisitedSchemas
instance Data.Semigroup.Semigroup JSONSchema.Validator.Draft4.Any.VisitedSchemas
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.VisitedSchemas
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.VisitedSchemas
instance GHC.Show.Show JSONSchema.Validator.Draft4.Any.Ref
instance GHC.Classes.Eq JSONSchema.Validator.Draft4.Any.Ref
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Any.NotValidator schema)
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Any.OneOf schema)
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Any.AnyOf schema)
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Any.AllOf schema)
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Any.TypeContext
instance Data.Semigroup.Semigroup JSONSchema.Validator.Draft4.Any.TypeValidator
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Any.TypeValidator
instance Data.Aeson.Types.ToJSON.ToJSON JSONSchema.Validator.Draft4.Any.TypeValidator
instance Test.QuickCheck.Arbitrary.Arbitrary JSONSchema.Validator.Draft4.Any.TypeValidator
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Any.SchemaType
instance Data.Aeson.Types.ToJSON.ToJSON JSONSchema.Validator.Draft4.Any.SchemaType
instance Test.QuickCheck.Arbitrary.Arbitrary JSONSchema.Validator.Draft4.Any.SchemaType
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Any.EnumValidator
instance Test.QuickCheck.Arbitrary.Arbitrary JSONSchema.Validator.Draft4.Any.EnumValidator
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Validator.Draft4.Any.Ref


-- | Turn the validation functions into actual <a>Validator</a>s.
--   
--   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.
module JSONSchema.Validator.Draft4

-- | 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.
run :: FromJSON b => (a -> b -> Maybe c) -> Maybe a -> Value -> [c]

-- | For internal use.
noEmbedded :: a -> ([b], [b])
multipleOfValidator :: Validator a (Maybe MultipleOf) MultipleOfInvalid
maximumValidator :: Validator a (Maybe Maximum) MaximumInvalid
minimumValidator :: Validator a (Maybe Minimum) MinimumInvalid
maxLengthValidator :: Validator a (Maybe MaxLength) MaxLengthInvalid
minLengthValidator :: Validator a (Maybe MinLength) MinLengthInvalid
patternValidator :: Validator a (Maybe PatternValidator) PatternInvalid
maxItemsValidator :: Validator a (Maybe MaxItems) MaxItemsInvalid
minItemsValidator :: Validator a (Maybe MinItems) MinItemsInvalid
uniqueItemsValidator :: Validator a (Maybe UniqueItems) UniqueItemsInvalid
itemsRelatedValidator :: (schema -> Value -> [err]) -> Validator schema (ItemsRelated schema) (ItemsRelatedInvalid err)
maxPropertiesValidator :: Validator a (Maybe MaxProperties) MaxPropertiesInvalid
minPropertiesValidator :: Validator a (Maybe MinProperties) MinPropertiesInvalid
requiredValidator :: Validator a (Maybe Required) RequiredInvalid
dependenciesValidator :: (schema -> Value -> [err]) -> Validator schema (Maybe (DependenciesValidator schema)) (DependenciesInvalid err)
propertiesRelatedValidator :: (schema -> Value -> [err]) -> Validator schema (PropertiesRelated schema) (PropertiesRelatedInvalid err)
newtype Definitions schema
Definitions :: HashMap Text schema -> Definitions schema
[_unDefinitions] :: Definitions schema -> HashMap Text schema
definitionsEmbedded :: Validator schema (Maybe (Definitions schema)) err
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)
enumValidator :: Validator a (Maybe EnumValidator) EnumInvalid
typeValidator :: Validator a (Maybe TypeContext) TypeValidatorInvalid
allOfValidator :: (schema -> Value -> [err]) -> Validator schema (Maybe (AllOf schema)) (AllOfInvalid err)
anyOfValidator :: (schema -> Value -> [err]) -> Validator schema (Maybe (AnyOf schema)) (AnyOfInvalid err)
oneOfValidator :: ToJSON schema => (schema -> Value -> [err]) -> Validator schema (Maybe (OneOf schema)) (OneOfInvalid err)
notValidator :: ToJSON schema => (schema -> Value -> [err]) -> Validator schema (Maybe (NotValidator schema)) NotValidatorInvalid
instance GHC.Show.Show schema => GHC.Show.Show (JSONSchema.Validator.Draft4.Definitions schema)
instance GHC.Classes.Eq schema => GHC.Classes.Eq (JSONSchema.Validator.Draft4.Definitions schema)
instance Data.Aeson.Types.FromJSON.FromJSON schema => Data.Aeson.Types.FromJSON.FromJSON (JSONSchema.Validator.Draft4.Definitions schema)

module JSONSchema.Draft4.Schema
data Schema
Schema :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe (HashMap Text Schema) -> HashMap Text Value -> Maybe Scientific -> Maybe Scientific -> Maybe Bool -> Maybe Scientific -> Maybe Bool -> Maybe Int -> Maybe Int -> Maybe Text -> Maybe Int -> Maybe Int -> Maybe Bool -> Maybe (Items Schema) -> Maybe (AdditionalItems Schema) -> Maybe Int -> Maybe Int -> Maybe (Set Text) -> Maybe (HashMap Text (Dependency Schema)) -> Maybe (HashMap Text Schema) -> Maybe (HashMap Text Schema) -> Maybe (AdditionalProperties Schema) -> Maybe (NonEmpty Value) -> Maybe TypeValidator -> Maybe (NonEmpty Schema) -> Maybe (NonEmpty Schema) -> Maybe (NonEmpty Schema) -> Maybe Schema -> Schema
[_schemaVersion] :: Schema -> Maybe Text
[_schemaId] :: Schema -> Maybe Text
[_schemaRef] :: Schema -> Maybe Text

-- | A standardized location for embedding schemas to be referenced from
--   elsewhere in the document.
[_schemaDefinitions] :: Schema -> Maybe (HashMap Text Schema)

-- | Since the JSON document this schema was built from could contain
--   schemas anywhere (not just in "definitions" or any of the other
--   official keys) we save any leftover key/value pairs not covered by
--   them here.
--   
--   TODO: This field is the source of most of the complication in this
--   module and needs to be removed. It should be doable, though it will
--   involve some modification to the fetching code.
[_schemaOther] :: Schema -> HashMap Text Value
[_schemaMultipleOf] :: Schema -> Maybe Scientific
[_schemaMaximum] :: Schema -> Maybe Scientific
[_schemaExclusiveMaximum] :: Schema -> Maybe Bool
[_schemaMinimum] :: Schema -> Maybe Scientific
[_schemaExclusiveMinimum] :: Schema -> Maybe Bool
[_schemaMaxLength] :: Schema -> Maybe Int
[_schemaMinLength] :: Schema -> Maybe Int
[_schemaPattern] :: Schema -> Maybe Text
[_schemaMaxItems] :: Schema -> Maybe Int
[_schemaMinItems] :: Schema -> Maybe Int
[_schemaUniqueItems] :: Schema -> Maybe Bool
[_schemaItems] :: Schema -> Maybe (Items Schema)
[_schemaAdditionalItems] :: Schema -> Maybe (AdditionalItems Schema)
[_schemaMaxProperties] :: Schema -> Maybe Int
[_schemaMinProperties] :: Schema -> Maybe Int
[_schemaRequired] :: Schema -> Maybe (Set Text)
[_schemaDependencies] :: Schema -> Maybe (HashMap Text (Dependency Schema))
[_schemaProperties] :: Schema -> Maybe (HashMap Text Schema)
[_schemaPatternProperties] :: Schema -> Maybe (HashMap Text Schema)
[_schemaAdditionalProperties] :: Schema -> Maybe (AdditionalProperties Schema)
[_schemaEnum] :: Schema -> Maybe (NonEmpty Value)
[_schemaType] :: Schema -> Maybe TypeValidator
[_schemaAllOf] :: Schema -> Maybe (NonEmpty Schema)
[_schemaAnyOf] :: Schema -> Maybe (NonEmpty Schema)
[_schemaOneOf] :: Schema -> Maybe (NonEmpty Schema)
[_schemaNot] :: Schema -> Maybe Schema
emptySchema :: Schema

-- | Internal. Separate from ToJSON because it's also used by FromJSON to
--   determine what keys aren't official schema keys and therefor should be
--   included in _schemaOther.
internalSchemaHashMap :: HashMap Text (Schema -> Maybe Value)
instance GHC.Show.Show JSONSchema.Draft4.Schema.Schema
instance GHC.Classes.Eq JSONSchema.Draft4.Schema.Schema
instance Data.Aeson.Types.FromJSON.FromJSON JSONSchema.Draft4.Schema.Schema
instance Data.Aeson.Types.ToJSON.ToJSON JSONSchema.Draft4.Schema.Schema
instance Test.QuickCheck.Arbitrary.Arbitrary JSONSchema.Draft4.Schema.Schema

module JSONSchema.Draft4.Failure

-- | Used to report an entire instance being invalidated, as opposed to the
--   failure of a single validator.
data Invalid
Invalid :: Schema -> Value -> NonEmpty ValidatorFailure -> Invalid
[_invalidSchema] :: Invalid -> Schema
[_invalidInstance] :: Invalid -> Value
[_invalidFailures] :: Invalid -> NonEmpty ValidatorFailure
data ValidatorFailure
FailureMultipleOf :: MultipleOfInvalid -> ValidatorFailure
FailureMaximum :: MaximumInvalid -> ValidatorFailure
FailureMinimum :: MinimumInvalid -> ValidatorFailure
FailureMaxLength :: MaxLengthInvalid -> ValidatorFailure
FailureMinLength :: MinLengthInvalid -> ValidatorFailure
FailurePattern :: PatternInvalid -> ValidatorFailure
FailureMaxItems :: MaxItemsInvalid -> ValidatorFailure
FailureMinItems :: MinItemsInvalid -> ValidatorFailure
FailureUniqueItems :: UniqueItemsInvalid -> ValidatorFailure
FailureItems :: (ItemsInvalid ValidatorFailure) -> ValidatorFailure
FailureAdditionalItems :: (AdditionalItemsInvalid ValidatorFailure) -> ValidatorFailure
FailureMaxProperties :: MaxPropertiesInvalid -> ValidatorFailure
FailureMinProperties :: MinPropertiesInvalid -> ValidatorFailure
FailureRequired :: RequiredInvalid -> ValidatorFailure
FailureDependencies :: (DependenciesInvalid ValidatorFailure) -> ValidatorFailure
FailurePropertiesRelated :: (PropertiesRelatedInvalid ValidatorFailure) -> ValidatorFailure
FailureRef :: (RefInvalid ValidatorFailure) -> ValidatorFailure
FailureEnum :: EnumInvalid -> ValidatorFailure
FailureType :: TypeValidatorInvalid -> ValidatorFailure
FailureAllOf :: (AllOfInvalid ValidatorFailure) -> ValidatorFailure
FailureAnyOf :: (AnyOfInvalid ValidatorFailure) -> ValidatorFailure
FailureOneOf :: (OneOfInvalid ValidatorFailure) -> ValidatorFailure
FailureNot :: NotValidatorInvalid -> ValidatorFailure

-- | A description of why a schema (or one of its reference) is itself
--   invalid.
--   
--   <a>Nothing</a> indicates the starting schema. <a>Just</a> indicates a
--   referenced schema. The contents of the <a>Just</a> is the schema's
--   URI.
--   
--   NOTE: 'HashMap (Maybe Text) Invalid' would be a nicer way of defining
--   this, but then we lose the guarantee that there's at least one key.
newtype SchemaInvalid
SchemaInvalid :: NonEmpty (Maybe Text, NonEmpty ValidatorFailure) -> SchemaInvalid
[_unSchemaInvalid] :: SchemaInvalid -> NonEmpty (Maybe Text, NonEmpty ValidatorFailure)
instance GHC.Show.Show JSONSchema.Draft4.Failure.SchemaInvalid
instance GHC.Classes.Eq JSONSchema.Draft4.Failure.SchemaInvalid
instance GHC.Show.Show JSONSchema.Draft4.Failure.Invalid
instance GHC.Classes.Eq JSONSchema.Draft4.Failure.Invalid
instance GHC.Show.Show JSONSchema.Draft4.Failure.ValidatorFailure
instance GHC.Classes.Eq JSONSchema.Draft4.Failure.ValidatorFailure

module JSONSchema.Draft4.Spec

-- | An implementation of <a>embedded</a>.
embedded :: Schema -> ([Schema], [Schema])
specValidate :: URISchemaMap Schema -> SchemaWithURI Schema -> Value -> [ValidatorFailure]
validateSubschema :: URISchemaMap Schema -> VisitedSchemas -> Scope Schema -> Schema -> Value -> [ValidatorFailure]
d4Spec :: URISchemaMap Schema -> VisitedSchemas -> Scope Schema -> Spec Schema ValidatorFailure

module JSONSchema.Draft4

-- | A top-level schema along with its location.
data SchemaWithURI schema
SchemaWithURI :: !schema -> !(Maybe Text) -> SchemaWithURI schema
[_swSchema] :: SchemaWithURI schema -> !schema

-- | This is the URI from which the document was originally fetched. It's
--   different than the schema's "id" field, which controls scope when
--   resolving references contained in the schema.
[_swURI] :: SchemaWithURI schema -> !(Maybe Text)
data Schema
Schema :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe (HashMap Text Schema) -> HashMap Text Value -> Maybe Scientific -> Maybe Scientific -> Maybe Bool -> Maybe Scientific -> Maybe Bool -> Maybe Int -> Maybe Int -> Maybe Text -> Maybe Int -> Maybe Int -> Maybe Bool -> Maybe (Items Schema) -> Maybe (AdditionalItems Schema) -> Maybe Int -> Maybe Int -> Maybe (Set Text) -> Maybe (HashMap Text (Dependency Schema)) -> Maybe (HashMap Text Schema) -> Maybe (HashMap Text Schema) -> Maybe (AdditionalProperties Schema) -> Maybe (NonEmpty Value) -> Maybe TypeValidator -> Maybe (NonEmpty Schema) -> Maybe (NonEmpty Schema) -> Maybe (NonEmpty Schema) -> Maybe Schema -> Schema
[_schemaVersion] :: Schema -> Maybe Text
[_schemaId] :: Schema -> Maybe Text
[_schemaRef] :: Schema -> Maybe Text

-- | A standardized location for embedding schemas to be referenced from
--   elsewhere in the document.
[_schemaDefinitions] :: Schema -> Maybe (HashMap Text Schema)

-- | Since the JSON document this schema was built from could contain
--   schemas anywhere (not just in "definitions" or any of the other
--   official keys) we save any leftover key/value pairs not covered by
--   them here.
--   
--   TODO: This field is the source of most of the complication in this
--   module and needs to be removed. It should be doable, though it will
--   involve some modification to the fetching code.
[_schemaOther] :: Schema -> HashMap Text Value
[_schemaMultipleOf] :: Schema -> Maybe Scientific
[_schemaMaximum] :: Schema -> Maybe Scientific
[_schemaExclusiveMaximum] :: Schema -> Maybe Bool
[_schemaMinimum] :: Schema -> Maybe Scientific
[_schemaExclusiveMinimum] :: Schema -> Maybe Bool
[_schemaMaxLength] :: Schema -> Maybe Int
[_schemaMinLength] :: Schema -> Maybe Int
[_schemaPattern] :: Schema -> Maybe Text
[_schemaMaxItems] :: Schema -> Maybe Int
[_schemaMinItems] :: Schema -> Maybe Int
[_schemaUniqueItems] :: Schema -> Maybe Bool
[_schemaItems] :: Schema -> Maybe (Items Schema)
[_schemaAdditionalItems] :: Schema -> Maybe (AdditionalItems Schema)
[_schemaMaxProperties] :: Schema -> Maybe Int
[_schemaMinProperties] :: Schema -> Maybe Int
[_schemaRequired] :: Schema -> Maybe (Set Text)
[_schemaDependencies] :: Schema -> Maybe (HashMap Text (Dependency Schema))
[_schemaProperties] :: Schema -> Maybe (HashMap Text Schema)
[_schemaPatternProperties] :: Schema -> Maybe (HashMap Text Schema)
[_schemaAdditionalProperties] :: Schema -> Maybe (AdditionalProperties Schema)
[_schemaEnum] :: Schema -> Maybe (NonEmpty Value)
[_schemaType] :: Schema -> Maybe TypeValidator
[_schemaAllOf] :: Schema -> Maybe (NonEmpty Schema)
[_schemaAnyOf] :: Schema -> Maybe (NonEmpty Schema)
[_schemaOneOf] :: Schema -> Maybe (NonEmpty Schema)
[_schemaNot] :: Schema -> Maybe Schema
emptySchema :: Schema

-- | Fetch recursively referenced schemas over HTTP, check that both the
--   original and referenced schemas are valid, then validate then data.
fetchHTTPAndValidate :: SchemaWithURI Schema -> Value -> IO (Either HTTPValidationFailure ())
data HTTPValidationFailure
HVRequest :: HTTPFailure -> HTTPValidationFailure
HVSchema :: SchemaInvalid -> HTTPValidationFailure
HVData :: Invalid -> HTTPValidationFailure
data HTTPFailure
HTTPParseFailure :: Text -> HTTPFailure
HTTPRequestFailure :: HttpException -> HTTPFailure

-- | A description of why a schema (or one of its reference) is itself
--   invalid.
--   
--   <a>Nothing</a> indicates the starting schema. <a>Just</a> indicates a
--   referenced schema. The contents of the <a>Just</a> is the schema's
--   URI.
--   
--   NOTE: 'HashMap (Maybe Text) Invalid' would be a nicer way of defining
--   this, but then we lose the guarantee that there's at least one key.
newtype SchemaInvalid
SchemaInvalid :: NonEmpty (Maybe Text, NonEmpty ValidatorFailure) -> SchemaInvalid
[_unSchemaInvalid] :: SchemaInvalid -> NonEmpty (Maybe Text, NonEmpty ValidatorFailure)

-- | Fetch recursively referenced schemas from the filesystem, check that
--   both the original and referenced schemas are valid, then validate the
--   data.
fetchFilesystemAndValidate :: SchemaWithURI Schema -> Value -> IO (Either FilesystemValidationFailure ())
data FilesystemValidationFailure
FVRead :: FilesystemFailure -> FilesystemValidationFailure
FVSchema :: SchemaInvalid -> FilesystemValidationFailure
FVData :: Invalid -> FilesystemValidationFailure
data FilesystemFailure
FSParseFailure :: Text -> FilesystemFailure
FSReadFailure :: IOException -> FilesystemFailure

-- | Used to report an entire instance being invalidated, as opposed to the
--   failure of a single validator.
data Invalid
Invalid :: Schema -> Value -> NonEmpty ValidatorFailure -> Invalid
[_invalidSchema] :: Invalid -> Schema
[_invalidInstance] :: Invalid -> Value
[_invalidFailures] :: Invalid -> NonEmpty ValidatorFailure
data ValidatorFailure
FailureMultipleOf :: MultipleOfInvalid -> ValidatorFailure
FailureMaximum :: MaximumInvalid -> ValidatorFailure
FailureMinimum :: MinimumInvalid -> ValidatorFailure
FailureMaxLength :: MaxLengthInvalid -> ValidatorFailure
FailureMinLength :: MinLengthInvalid -> ValidatorFailure
FailurePattern :: PatternInvalid -> ValidatorFailure
FailureMaxItems :: MaxItemsInvalid -> ValidatorFailure
FailureMinItems :: MinItemsInvalid -> ValidatorFailure
FailureUniqueItems :: UniqueItemsInvalid -> ValidatorFailure
FailureItems :: (ItemsInvalid ValidatorFailure) -> ValidatorFailure
FailureAdditionalItems :: (AdditionalItemsInvalid ValidatorFailure) -> ValidatorFailure
FailureMaxProperties :: MaxPropertiesInvalid -> ValidatorFailure
FailureMinProperties :: MinPropertiesInvalid -> ValidatorFailure
FailureRequired :: RequiredInvalid -> ValidatorFailure
FailureDependencies :: (DependenciesInvalid ValidatorFailure) -> ValidatorFailure
FailurePropertiesRelated :: (PropertiesRelatedInvalid ValidatorFailure) -> ValidatorFailure
FailureRef :: (RefInvalid ValidatorFailure) -> ValidatorFailure
FailureEnum :: EnumInvalid -> ValidatorFailure
FailureType :: TypeValidatorInvalid -> ValidatorFailure
FailureAllOf :: (AllOfInvalid ValidatorFailure) -> ValidatorFailure
FailureAnyOf :: (AnyOfInvalid ValidatorFailure) -> ValidatorFailure
FailureOneOf :: (OneOfInvalid ValidatorFailure) -> ValidatorFailure
FailureNot :: NotValidatorInvalid -> ValidatorFailure

-- | Keys are URIs (without URI fragments).
newtype URISchemaMap schema
URISchemaMap :: HashMap Text schema -> URISchemaMap schema
[_unURISchemaMap] :: URISchemaMap schema -> HashMap Text schema

-- | Fetch the schemas recursively referenced by a starting schema over
--   HTTP.
referencesViaHTTP :: SchemaWithURI Schema -> IO (Either HTTPFailure (URISchemaMap Schema))

-- | Fetch the schemas recursively referenced by a starting schema from the
--   filesystem.
referencesViaFilesystem :: SchemaWithURI Schema -> IO (Either FilesystemFailure (URISchemaMap Schema))
metaSchema :: Schema
metaSchemaBytes :: ByteString

-- | Check that a schema itself is valid (if so the returned list will be
--   empty).
schemaValidity :: Schema -> [ValidatorFailure]

-- | Check that a set of referenced schemas are valid (if so the returned
--   list will be empty).
referencesValidity :: URISchemaMap Schema -> [(Text, NonEmpty ValidatorFailure)]

-- | Checks if a schema and a set of referenced schemas are valid.
--   
--   Return a function to validate data.
checkSchema :: URISchemaMap Schema -> SchemaWithURI Schema -> Either SchemaInvalid (Value -> [ValidatorFailure])

-- | An instance of <a>FetchInfo</a> specialized for JSON Schema Draft 4.
draft4FetchInfo :: FetchInfo Schema
instance GHC.Classes.Eq JSONSchema.Draft4.FilesystemValidationFailure
instance GHC.Show.Show JSONSchema.Draft4.FilesystemValidationFailure
instance GHC.Show.Show JSONSchema.Draft4.HTTPValidationFailure
