Safe Haskell | None |
---|---|
Language | Haskell2010 |
- compile :: Spec -> Graph -> RawSchema -> Schema
- validate :: Schema -> Value -> Vector ValErr
- newtype Spec = Spec {}
- type Graph = HashMap Text (HashMap Text Value)
- type ValErr = Text
- type Validator = Value -> Vector ValErr
- type Schema = Vector Validator
- type ValidatorGen = Spec -> Graph -> RawSchema -> Value -> Maybe Validator
- type EmbeddedSchemas = Text -> Value -> Vector RawSchema
- data RawSchema = RawSchema {}
- draft4 :: Spec
- isValidSchema :: RawSchema -> Vector ValErr
- fetchRefs :: Spec -> RawSchema -> Graph -> IO (Either Text Graph)
Primary API
Types
type EmbeddedSchemas = Text -> Value -> Vector RawSchema Source
Return a schema's immediate subschemas.
This is used by fetchRefs
to find all the
subschemas in a document. This allows it to process only
"$ref"s and "id"s that are actual schema keywords.
Draft 4 Specific
isValidSchema :: RawSchema -> Vector ValErr Source
Graph Builder
TODO: It would be nice to have a few other functions for building
out Graph
s depending on the situation. For instance, there could be
a function that only fetched "$ref"s which use the "file://" scheme.