Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Autodocodec.Schema
Synopsis
- data JSONSchema
- = AnySchema
- | NullSchema
- | BoolSchema
- | StringSchema
- | NumberSchema !(Maybe NumberBounds)
- | ArraySchema !JSONSchema
- | MapSchema !JSONSchema
- | ObjectSchema !ObjectSchema
- | ValueSchema !Value
- | AnyOfSchema !(NonEmpty JSONSchema)
- | OneOfSchema !(NonEmpty JSONSchema)
- | CommentSchema !Text !JSONSchema
- | RefSchema !Text
- | WithDefSchema !(Map Text JSONSchema) !JSONSchema
- data ObjectSchema
- defsPrefix :: Text
- validateAccordingTo :: Value -> JSONSchema -> Bool
- data KeyRequirement
- jsonSchemaViaCodec :: forall a. HasCodec a => JSONSchema
- jsonSchemaVia :: ValueCodec input output -> JSONSchema
- uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d
Documentation
data JSONSchema Source #
A JSON Schema
http://json-schema.org/understanding-json-schema/reference/index.html
Contrary to a Codec
, values of this type should be finite.
NOTE: This schema roundtrips to JSON, but it cannot expres everything that a fully-featured json-schema may be able to express.
Constructors
AnySchema | |
NullSchema | |
BoolSchema | |
StringSchema | |
NumberSchema !(Maybe NumberBounds) | |
ArraySchema !JSONSchema | |
MapSchema !JSONSchema | |
ObjectSchema !ObjectSchema | This needs to be a list because keys should stay in their original ordering. |
ValueSchema !Value | |
AnyOfSchema !(NonEmpty JSONSchema) | |
OneOfSchema !(NonEmpty JSONSchema) | |
CommentSchema !Text !JSONSchema | |
RefSchema !Text | |
WithDefSchema !(Map Text JSONSchema) !JSONSchema |
Instances
data ObjectSchema Source #
Constructors
Instances
defsPrefix :: Text Source #
validateAccordingTo :: Value -> JSONSchema -> Bool Source #
data KeyRequirement Source #
Instances
jsonSchemaViaCodec :: forall a. HasCodec a => JSONSchema Source #
jsonSchemaVia :: ValueCodec input output -> JSONSchema Source #