Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines a TypedSchema
for the Schema
datatype,
inspired in the OpenApi 2.0 specification, which may be useful
to render Schema
values in OpeApi 2.0 format
Synopsis
- data OpenApi2Document = OpenApi2Document {
- definitions :: HashMap Text OpenApi2Schema
- failures :: HashMap Text Reason
- data OpenApi2Schema = OpenApi2Schema {
- _type :: OpenApi2Type
- additionalProperties :: Maybe OpenApi2Schema
- discriminator :: Maybe Text
- enum :: Maybe [Text]
- format :: Maybe Text
- items :: Maybe OpenApi2Schema
- properties :: Maybe (HashMap Text OpenApi2Schema)
- required :: Maybe [Text]
- defOpenApi2Schema :: OpenApi2Type -> OpenApi2Schema
- data OpenApi2Type
- data OpenApi2Options = OpenApi2Options {
- primMapping :: Text -> Maybe OpenApi2Schema
- defaultOptions :: OpenApi2Options
- toOpenApi2Document :: OpenApi2Options -> HashMap Text Schema -> OpenApi2Document
- encodeAsOpenApi2Document :: OpenApi2Options -> Text -> Schema -> Value
Documentation
data OpenApi2Document Source #
A catalog of definitions
OpenApi2Document | |
|
Instances
Show OpenApi2Document Source # | |
Defined in Schemas.OpenApi2 showsPrec :: Int -> OpenApi2Document -> ShowS # show :: OpenApi2Document -> String # showList :: [OpenApi2Document] -> ShowS # | |
Semigroup OpenApi2Document Source # | |
Defined in Schemas.OpenApi2 (<>) :: OpenApi2Document -> OpenApi2Document -> OpenApi2Document # sconcat :: NonEmpty OpenApi2Document -> OpenApi2Document # stimes :: Integral b => b -> OpenApi2Document -> OpenApi2Document # | |
Monoid OpenApi2Document Source # | |
Defined in Schemas.OpenApi2 | |
HasSchema OpenApi2Document Source # | |
Defined in Schemas.OpenApi2 |
data OpenApi2Schema Source #
The representation of an OpenApi 2.0 schema
OpenApi2Schema | |
|
Instances
data OpenApi2Type Source #
Instances
Bounded OpenApi2Type Source # | |
Defined in Schemas.OpenApi2 | |
Enum OpenApi2Type Source # | |
Defined in Schemas.OpenApi2 succ :: OpenApi2Type -> OpenApi2Type # pred :: OpenApi2Type -> OpenApi2Type # toEnum :: Int -> OpenApi2Type # fromEnum :: OpenApi2Type -> Int # enumFrom :: OpenApi2Type -> [OpenApi2Type] # enumFromThen :: OpenApi2Type -> OpenApi2Type -> [OpenApi2Type] # enumFromTo :: OpenApi2Type -> OpenApi2Type -> [OpenApi2Type] # enumFromThenTo :: OpenApi2Type -> OpenApi2Type -> OpenApi2Type -> [OpenApi2Type] # | |
Eq OpenApi2Type Source # | |
Defined in Schemas.OpenApi2 (==) :: OpenApi2Type -> OpenApi2Type -> Bool # (/=) :: OpenApi2Type -> OpenApi2Type -> Bool # | |
Show OpenApi2Type Source # | |
Defined in Schemas.OpenApi2 showsPrec :: Int -> OpenApi2Type -> ShowS # show :: OpenApi2Type -> String # showList :: [OpenApi2Type] -> ShowS # | |
HasSchema OpenApi2Type Source # | |
Defined in Schemas.OpenApi2 |
data OpenApi2Options Source #
OpenApi2Options | |
|
encodeAsOpenApi2Document :: OpenApi2Options -> Text -> Schema -> Value Source #
Given a schema free of undiscriminated unions
encodeAsOpenApi2Document name schema
produces an encoding of an
OpenApi2 document that models the given schema.
Failures are omitted, use toOpenApi2Document
if you care.