Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data Schema
- = SCSchema {
- scId :: !Text
- scUsedSchema :: !Text
- scSchemaType :: !Schema
- scDefinitions :: ![(Text, Schema)]
- | SCString {
- scDescription :: !(Maybe Text)
- scNullable :: !Bool
- scFormat :: !(Maybe Text)
- scLowerBound :: !(Maybe Integer)
- scUpperBound :: !(Maybe Integer)
- | SCInteger {
- scDescription :: !(Maybe Text)
- scNullable :: !Bool
- scLowerBound :: !(Maybe Integer)
- scUpperBound :: !(Maybe Integer)
- | SCNumber {
- scDescription :: !(Maybe Text)
- scNullable :: !Bool
- scLowerBound :: !(Maybe Integer)
- scUpperBound :: !(Maybe Integer)
- | SCBoolean {
- scDescription :: !(Maybe Text)
- scNullable :: !Bool
- | SCConst { }
- | SCObject {
- scTitle :: !Text
- scDescription :: !(Maybe Text)
- scNullable :: !Bool
- scProperties :: ![(Text, Schema)]
- scPatternProps :: ![(Text, Schema)]
- scRequired :: ![Text]
- | SCArray {
- scTitle :: !Text
- scDescription :: !(Maybe Text)
- scNullable :: !Bool
- scItems :: ![Schema]
- scLowerBound :: !(Maybe Integer)
- scUpperBound :: !(Maybe Integer)
- | SCOneOf {
- scTitle :: !Text
- scDescription :: !(Maybe Text)
- scNullable :: !Bool
- scChoices :: ![SchemaChoice]
- | SCRef {
- scReference :: !Text
- scNullable :: !Bool
- | SCNull
- = SCSchema {
- data SchemaChoice
- scString :: Schema
- scInteger :: Schema
- scNumber :: Schema
- scBoolean :: Schema
Documentation
A schema for a JSON value.
data SchemaChoice Source #
A sum encoding for ADT.
A smart consturctor for String.
SCChoiceEnum | Encoding for constructors that are all unit type. e.g. "test": {"enum": ["xxx", "yyy", "zzz"]} |
SCChoiceArray | Encoding for constructors that are non record type. e.g. "test": [{"tag": "xxx", "contents": []},...] or "test": [{"xxx": [],},...] |
SCChoiceMap | Encoding for constructos that are record type. e.g. "test": [{"tag": "xxx", "contents": {"aaa": "yyy",...}},...] or "test": [{"xxx": []},...] |