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

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.JSON.Schema.Generator.Class

Synopsis

Documentation

class JSONSchemaGen a where Source

Minimal complete definition

Nothing

Methods

toSchema :: Options -> Proxy a -> Schema Source

class GJSONSchemaGen f where Source

Methods

gToSchema :: Options -> Proxy (f a) -> Schema Source

Instances

(Datatype d, SchemaType f) => GJSONSchemaGen (D1 d f) 

data Options Source

Options that specify how to generate schema definition automatically from your datatype.

Constructors

Options 

Fields

baseUri :: String

schema id prefix.

schemaIdSuffix :: String

schema id suffix. File extension for example.

typeRefMap :: Map TypeRep String

a mapping from datatypes to referenced schema ids.

fieldTypeMap :: Map String FieldType

a mapping to assign a preffered type to a field.

Instances

data FieldType Source

Constructors

forall a . JSONSchemaPrim a => FieldType (Proxy a) 

defaultOptions :: Options Source

Default geerating Options:

Options
{ baseUri        = ""
, schemaIdSuffix = ""
, refSchemaMap   = Map.empty
}