Safe Haskell | None |
---|---|
Language | Haskell98 |
Types for defining JSON schemas.
- class JSONSchema a where
- data Schema
- data Field = Field {}
- data Bound = Bound {}
- data LengthBound = LengthBound {
- lowerLength :: Maybe Int
- upperLength :: Maybe Int
- unbounded :: Bound
- unboundedLength :: LengthBound
Documentation
class JSONSchema a where Source
Class representing JSON schemas
A schema for a JSON value.
Choice [Schema] | A choice of multiple values, e.g. for sum types. |
Object [Field] | A JSON object. |
Map Schema | A JSON object with arbitrary keys. |
Array LengthBound Bool Schema | An array. The LengthBound represent the
lower and upper bound of the array
size. The value |
Tuple [Schema] | A fixed-length tuple of different values. |
Value LengthBound | A string. The LengthBound denote the lower and
upper bound of the length of the string. The
value |
Boolean | A Bool. |
Number Bound | A number. The Bound denote the lower and
upper bound on the value. The value |
Constant Value | A Value that never changes. Can be combined with Choice to create enumerables. |
Null | Only null is allowed. |
Any | Anything value is allowed. |
A field in an object.
A type for bounds on number domains. Use Nothing when no lower or upper bound makes sense
data LengthBound Source
A type for bounds on lengths for strings and arrays. Use Nothing when no lower or upper bound makes sense