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

Safe HaskellNone
LanguageHaskell98

Data.JSON.Schema.Types

Description

Types for defining JSON schemas.

Synopsis

Documentation

type Schema = Value Source

A schema is any JSON value.

data Value Source

A schema for a JSON value.

Constructors

Choice [Value]

A choice of multiple values, e.g. for sum types.

Object [Field]

A JSON object.

Map Value

A JSON object with arbitrary keys.

Array Int Int Bool Value

An array. The integers represent the lower and upper bound of the array size. The value -1 indicates no bound. The boolean denotes whether items have to unique.

Tuple [Value]

A fixed-length tuple of different values.

Value Int Int

A string. The integers denote the lower and upper bound of the length of the string. The value -1 indicates no bound.

Boolean 
Number Int Int

A number. The integers denote the lower and upper bound on the value. The value -1 indicates no bound.

Null 
Any 

Instances

data Field Source

A field in an object.

Constructors

Field 

Fields

key :: String
 
required :: Bool
 
content :: Schema
 

Instances