json-schema-0.7.3.0: Types and type classes for defining JSON schemas.

Safe HaskellNone
LanguageHaskell98

Data.JSON.Schema.Types

Description

Types for defining JSON schemas.

Synopsis

Documentation

class JSONSchema a where Source

Class representing JSON schemas

Methods

schema :: Proxy a -> Schema Source

Instances

JSONSchema Bool 
JSONSchema Double 
JSONSchema Float 
JSONSchema Int 
JSONSchema Int8 
JSONSchema Int16 
JSONSchema Int32 
JSONSchema Int64 
JSONSchema Integer 
JSONSchema Word 
JSONSchema Word8 
JSONSchema Word16 
JSONSchema Word32 
JSONSchema Word64 
JSONSchema () 
JSONSchema Scientific 
JSONSchema Text 
JSONSchema UTCTime 
JSONSchema Text 
JSONSchema a => JSONSchema [a] 
JSONSchema a => JSONSchema (Maybe a) 
HasResolution a => JSONSchema (Fixed a) 
JSONSchema a => JSONSchema (Set a) 
JSONSchema a => JSONSchema (Vector a) 
(JSONSchema a, JSONSchema b) => JSONSchema (a, b) 
(IsString k, JSONSchema v) => JSONSchema (HashMap k v) 
(IsString k, JSONSchema v) => JSONSchema (Map 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) 
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h) => JSONSchema (a, b, c, d, e, f, g, h) 
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i) => JSONSchema (a, b, c, d, e, f, g, h, i) 
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j) => JSONSchema (a, b, c, d, e, f, g, h, i, j) 
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k) 
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k, JSONSchema l) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k, l) 
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k, JSONSchema l, JSONSchema m) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k, l, m) 
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k, JSONSchema l, JSONSchema m, JSONSchema n) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 
(JSONSchema a, JSONSchema b, JSONSchema c, JSONSchema d, JSONSchema e, JSONSchema f, JSONSchema g, JSONSchema h, JSONSchema i, JSONSchema j, JSONSchema k, JSONSchema l, JSONSchema m, JSONSchema n, JSONSchema o) => JSONSchema (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 

data Schema Source

A schema for a JSON value.

Constructors

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 unboundedLength indicates no bound. The boolean denotes whether items have to be unique.

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 unboundedLength indicates no bound.

Boolean

A Bool.

Number Bound

A number. The Bound denote the lower and upper bound on the value. The value unbounded indicates no bound.

Constant Value

A Value that never changes. Can be combined with Choice to create enumerables.

Any

Any value is allowed.

Instances

data Field Source

A field in an object.

Constructors

Field 

Fields

key :: Text
 
required :: Bool
 
content :: Schema
 

Instances

data Bound Source

A type for bounds on number domains. Use Nothing when no lower or upper bound makes sense

Constructors

Bound 

Fields

lower :: Maybe Int
 
upper :: Maybe Int
 

Instances

data LengthBound Source

A type for bounds on lengths for strings and arrays. Use Nothing when no lower or upper bound makes sense

Constructors

LengthBound