Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data FetchInfo schema = FetchInfo {}
- newtype URISchemaMap schema = URISchemaMap {
- _unURISchemaMap :: HashMap Text schema
- data SchemaWithURI schema = SchemaWithURI {}
- getReference :: URISchemaMap schema -> Text -> Maybe schema
- data HTTPFailure
- referencesViaHTTP' :: forall schema. FromJSON schema => FetchInfo schema -> SchemaWithURI schema -> IO (Either HTTPFailure (URISchemaMap schema))
- data FilesystemFailure
- referencesViaFilesystem' :: forall schema. FromJSON schema => FetchInfo schema -> SchemaWithURI schema -> IO (Either FilesystemFailure (URISchemaMap schema))
- 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))
- includeSubschemas :: forall schema. FetchInfo schema -> SchemaWithURI schema -> [SchemaWithURI schema]
Types
data FetchInfo schema Source #
This is all the fetching functions need to know about a particular JSON Schema draft, e.g. JSON Schema Draft 4.
newtype URISchemaMap schema Source #
Keys are URIs (without URI fragments).
URISchemaMap | |
|
Eq schema => Eq (URISchemaMap schema) Source # | |
Show schema => Show (URISchemaMap schema) Source # | |
Monoid (URISchemaMap schema) Source # | |
data SchemaWithURI schema Source #
A top-level schema along with its location.
Eq schema => Eq (SchemaWithURI schema) Source # | |
Show schema => Show (SchemaWithURI schema) Source # | |
getReference :: URISchemaMap schema -> Text -> Maybe schema Source #
Fetch via HTTP
data HTTPFailure Source #
referencesViaHTTP' :: forall schema. FromJSON schema => FetchInfo schema -> SchemaWithURI schema -> IO (Either HTTPFailure (URISchemaMap schema)) Source #
Take a schema. Retrieve every document either it or its subschemas include via the "$ref" keyword.
Fetch via Filesystem
data FilesystemFailure Source #
referencesViaFilesystem' :: forall schema. FromJSON schema => FetchInfo schema -> SchemaWithURI schema -> IO (Either FilesystemFailure (URISchemaMap schema)) Source #
Method Agnostic Fetching Tools
referencesMethodAgnostic :: forall schema. FromJSON schema => (Text -> IO ByteString) -> FetchInfo schema -> SchemaWithURI schema -> IO (Either Text (URISchemaMap schema)) Source #
A version of fetchReferencedSchema
s where the function to fetch
schemas is provided by the user. This allows restrictions to be added,
e.g. rejecting non-local URIs.
getRecursiveReferences :: forall schema. FromJSON schema => (Text -> IO ByteString) -> FetchInfo schema -> URISchemaMap schema -> SchemaWithURI schema -> IO (Either Text (URISchemaMap schema)) Source #
includeSubschemas :: forall schema. FetchInfo schema -> SchemaWithURI schema -> [SchemaWithURI schema] Source #
Return the schema passed in as an argument, as well as every subschema contained within it.