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
JSONSchema Bool | |
JSONSchema Int | |
JSONSchema Integer | |
JSONSchema Word32 | |
JSONSchema () | |
JSONSchema UTCTime | |
JSONSchema Text | |
JSONSchema Text | |
JSONSchema a => JSONSchema [a] | |
JSONSchema a => JSONSchema (Maybe a) | |
JSONSchema a => JSONSchema (Set a) | |
JSONSchema a => JSONSchema (Vector a) | |
(JSONSchema a, JSONSchema b) => JSONSchema (a, b) | |
(IsString k, JSONSchema v) => JSONSchema (Map k v) | |
(IsString k, JSONSchema v) => JSONSchema (HashMap k v) | |
(JSONSchema a, JSONSchema b, JSONSchema c) => JSONSchema (a, b, c) | |
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d) => JSONSchema (a, b, c, d) | |
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e) => JSONSchema (a, b, c, d, e) | |
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f) => JSONSchema (a, b, c, d, e, f) | |
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g) => JSONSchema (a, b, c, d, e, f, g) |
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