License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.Doc.Schema.Refined
Description
Refined JSON schema after converting all JSON Value types to their specific sum types
Synopsis
- schemaJsonOptions :: Options
- data SchemaRaw = SchemaRaw {
- _description :: Maybe Text
- _default :: Maybe Value
- _title :: Maybe Text
- _type :: Maybe (SingleOrList Text)
- _name :: Maybe Text
- _properties :: Maybe (Map Text SwarmSchema)
- _items :: Maybe (ItemDescription SwarmSchema)
- _examples :: Maybe [Value]
- _Sref :: Maybe Text
- _oneOf :: Maybe [SchemaRaw]
- _footers :: Maybe [FilePath]
- _additionalProperties :: Maybe Bool
- _enum :: Maybe (NonEmpty Text)
- extractSchemaType :: SchemaRaw -> Maybe SchemaType
- data ItemDescription a
- getSchemaReferences :: SchemaType -> [SchemaIdReference]
- data SwarmSchema = SwarmSchema {}
- getMarkdown :: MonadFail m => Text -> m Pandoc
- toSwarmSchema :: MonadFail m => SchemaRaw -> m SwarmSchema
- extractReferences :: SwarmSchema -> Set SchemaIdReference
Basic
A single record that encompasses all possible objects in a JSON schema. All fields are optional.
Constructors
SchemaRaw | |
Fields
|
Instances
Refined
data ItemDescription a Source #
Instances
FromJSON a => FromJSON (ItemDescription a) Source # | |
Defined in Swarm.Doc.Schema.Refined Methods parseJSON :: Value -> Parser (ItemDescription a) # parseJSONList :: Value -> Parser [ItemDescription a] # omittedField :: Maybe (ItemDescription a) # | |
Show a => Show (ItemDescription a) Source # | |
Defined in Swarm.Doc.Schema.Refined Methods showsPrec :: Int -> ItemDescription a -> ShowS # show :: ItemDescription a -> String # showList :: [ItemDescription a] -> ShowS # | |
Eq a => Eq (ItemDescription a) Source # | |
Defined in Swarm.Doc.Schema.Refined Methods (==) :: ItemDescription a -> ItemDescription a -> Bool # (/=) :: ItemDescription a -> ItemDescription a -> Bool # | |
Ord a => Ord (ItemDescription a) Source # | |
Defined in Swarm.Doc.Schema.Refined Methods compare :: ItemDescription a -> ItemDescription a -> Ordering # (<) :: ItemDescription a -> ItemDescription a -> Bool # (<=) :: ItemDescription a -> ItemDescription a -> Bool # (>) :: ItemDescription a -> ItemDescription a -> Bool # (>=) :: ItemDescription a -> ItemDescription a -> Bool # max :: ItemDescription a -> ItemDescription a -> ItemDescription a # min :: ItemDescription a -> ItemDescription a -> ItemDescription a # |
data SwarmSchema Source #
A subset of all JSON schemas, conforming to internal Swarm conventions.
Conveniently, this extra representation layer
is able to enforce (via toSwarmSchema
) that all "object"
definitions in the schema contain the "additionalProperties": true
attribute.
Constructors
SwarmSchema | |
Fields
|
Instances
FromJSON SwarmSchema Source # | |
Defined in Swarm.Doc.Schema.Refined | |
Show SwarmSchema Source # | |
Defined in Swarm.Doc.Schema.Refined Methods showsPrec :: Int -> SwarmSchema -> ShowS # show :: SwarmSchema -> String # showList :: [SwarmSchema] -> ShowS # | |
Eq SwarmSchema Source # | |
Defined in Swarm.Doc.Schema.Refined | |
Ord SwarmSchema Source # | |
Defined in Swarm.Doc.Schema.Refined Methods compare :: SwarmSchema -> SwarmSchema -> Ordering # (<) :: SwarmSchema -> SwarmSchema -> Bool # (<=) :: SwarmSchema -> SwarmSchema -> Bool # (>) :: SwarmSchema -> SwarmSchema -> Bool # (>=) :: SwarmSchema -> SwarmSchema -> Bool # max :: SwarmSchema -> SwarmSchema -> SwarmSchema # min :: SwarmSchema -> SwarmSchema -> SwarmSchema # |
toSwarmSchema :: MonadFail m => SchemaRaw -> m SwarmSchema Source #
Utilities
extractReferences :: SwarmSchema -> Set SchemaIdReference Source #
Recursively extract references to other schemas