Safe Haskell | None |
---|---|
Language | Haskell98 |
Combinators for creating JSON schemas.
- type SchemaC = Schema -> Schema
- (<|>) :: Schema -> Schema -> Schema
- (<+>) :: Schema -> Schema -> Schema
- merge :: Schema -> Schema -> Schema
- field :: Text -> Bool -> Schema -> Schema
- value :: Schema
- number :: Schema
- array :: Schema -> Schema
- addField :: Text -> Bool -> Schema -> SchemaC
- addFields :: [(Text, Bool, Schema)] -> SchemaC
- empty :: Schema
- enum :: [Value] -> Schema
- unbounded :: Bound
- unboundedLength :: LengthBound
- nullable :: Schema -> Schema
Documentation
merge :: Schema -> Schema -> Schema Source
If passed two objects, merges the fields. Otherwise creates a tuple.
addField :: Text -> Bool -> Schema -> SchemaC Source
Add a field to an object, or tuple if passed a non-object.