| License | BSD-3-Clause |
|---|---|
| Safe Haskell | Safe-Inferred |
| 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
- 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
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