jsonschema-gen-0.3.0.0: JSON Schema generator from Algebraic data type

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.JSON.Schema.Generator.Types

Synopsis

Documentation

data Schema Source

A schema for a JSON value.

Constructors

SCSchema 

Fields

scId :: !Text
 
scUsedSchema :: !Text
 
scSchemaType :: !Schema
 
scDefinitions :: ![(Text, Schema)]
 
SCString 
SCInteger 
SCNumber 
SCBoolean 

Fields

scDescription :: !(Maybe Text)
 
scNullable :: !Bool
 
SCConst 

Fields

scTitle :: !Text
 
scDescription :: !(Maybe Text)
 
scValue :: !Text
 
SCObject 

Fields

scTitle :: !Text
 
scDescription :: !(Maybe Text)
 
scNullable :: !Bool
 
scProperties :: ![(Text, Schema)]
 
scPatternProps :: ![(Text, Schema)]
 
scRequired :: ![Text]
 
SCArray 

Fields

scTitle :: !Text
 
scDescription :: !(Maybe Text)
 
scNullable :: !Bool
 
scItems :: ![Schema]
 
scLowerBound :: !(Maybe Integer)
 
scUpperBound :: !(Maybe Integer)
 
SCOneOf 

Fields

scTitle :: !Text
 
scDescription :: !(Maybe Text)
 
scNullable :: !Bool
 
scChoices :: ![SchemaChoice]
 
SCRef 

Fields

scReference :: !Text
 
scNullable :: !Bool
 
SCNull 

Instances

data SchemaChoice Source

A sum encoding for ADT.

A smart consturctor for String.

Constructors

SCChoiceEnum

Encoding for constructors that are all unit type. e.g. "test": {"enum": ["xxx", "yyy", "zzz"]}

Fields

sctName :: !Text
 
sctTitle :: !Text
 
SCChoiceArray

Encoding for constructors that are non record type. e.g. "test": [{"tag": "xxx", "contents": []},...] or "test": [{"xxx": [],},...]

Fields

sctName :: !Text
 
sctTitle :: !Text
 
sctArray :: ![Schema]
 
SCChoiceMap

Encoding for constructos that are record type. e.g. "test": [{"tag": "xxx", "contents": {"aaa": "yyy",...}},...] or "test": [{"xxx": []},...]

Fields

sctName :: !Text
 
sctTitle :: !Text
 
sctMap :: ![(Text, Schema)]
 
sctRequired :: ![Text]
 

Instances

scString :: Schema Source

A smart consturctor for Integer.

scInteger :: Schema Source

A smart consturctor for Number.

scNumber :: Schema Source

A smart consturctor for Boolean.