aeson-schema-0.3.0.6: Haskell JSON schema validator and parser generator

Safe HaskellNone
LanguageHaskell98

Data.Aeson.Schema.CodeGen

Synopsis

Documentation

data Declaration Source

A top-level declaration.

Constructors

Declaration Dec (Maybe Text)

Optional textual declaration. This can be used for information (e.g. inline comments) that are not representable in TH.

Comment Text

Comment text

type Code = [Declaration] Source

 Haskell code (without module declaration and imports)

generate :: Graph Schema Text -> Q (Code, Map Text Name) Source

 Generate a generalized representation of the code in a Haskell module

generateTH Source

Arguments

:: Graph Schema Text

Set of schemas

-> Q ([Dec], Map Text Name)

Generated code and mapping from schema identifiers to type names

 Generate data-types and FromJSON instances for all schemas

generateModule Source

Arguments

:: Text

Name of the generated module

-> Graph Schema Text

Set of schemas

-> Q (Text, Map Text Name)

Module code and mapping from schema identifiers to type names

 Generated a self-contained module that parses and validates values of a set of given schemas.