Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal module that provides JSON parser and serializers that convert to OpenAPI documentation.
Note that this module is full of internal-use-only functions and should probably n ever actually be imported.
Synopsis
- newtype ConstDeclare env r a = ConstDeclare {
- runConstDeclare :: Declare env r
- data PropertyDeclare = PropertyDeclare {}
- addDescription :: Text -> Referenced Schema -> Referenced Schema
- newtype ObjectSchema a = ObjectSchema {}
- newtype TupleSchema a = TupleSchema {}
- newtype JSONSchema a = JSONSchema {}
- sameTypes :: Schema -> Schema -> Bool
- bothHaveEnum :: Schema -> Schema -> Bool
- enumValues :: Schema -> [Value]
- combineInline :: Schema -> Schema -> Schema
- combineSchemas :: Referenced Schema -> Referenced Schema -> Schema
- getJSONRef :: forall a. FromJSON a => Proxy a -> Declare (Definitions Schema) (Referenced Schema)
- getRefDef :: Declare (Definitions Schema) NamedSchema -> Declare (Definitions Schema) (Referenced Schema)
- onlyUnnamed :: Schema -> JSONSchema a
- encodeRefName :: Text -> Text
- getFromNamed :: forall a. FromJSON a => Proxy a -> Declare (Definitions Schema) NamedSchema
- getFromRef :: forall a. FromJSON a => Proxy a -> Declare (Definitions Schema) (Referenced Schema)
- getToNamed :: forall a. ToJSON a => Proxy a -> Declare (Definitions Schema) NamedSchema
- getToRef :: forall a. ToJSON a => Proxy a -> Declare (Definitions Schema) (Referenced Schema)
Documentation
newtype ConstDeclare env r a Source #
Declare with a phantom type parameter.
ConstDeclare | |
|
Instances
Functor (ConstDeclare env r) Source # | Fmap ignores argument |
Defined in Jordan.OpenAPI.Internal fmap :: (a -> b) -> ConstDeclare env r a -> ConstDeclare env r b # (<$) :: a -> ConstDeclare env r b -> ConstDeclare env r a # | |
(Monoid r, Monoid env) => Applicative (ConstDeclare env r) Source # | Applicative combines declarations. |
Defined in Jordan.OpenAPI.Internal pure :: a -> ConstDeclare env r a # (<*>) :: ConstDeclare env r (a -> b) -> ConstDeclare env r a -> ConstDeclare env r b # liftA2 :: (a -> b -> c) -> ConstDeclare env r a -> ConstDeclare env r b -> ConstDeclare env r c # (*>) :: ConstDeclare env r a -> ConstDeclare env r b -> ConstDeclare env r b # (<*) :: ConstDeclare env r a -> ConstDeclare env r b -> ConstDeclare env r a # | |
Contravariant (ConstDeclare env r) Source # | Contravariant ignores argument. |
Defined in Jordan.OpenAPI.Internal contramap :: (a -> b) -> ConstDeclare env r b -> ConstDeclare env r a # (>$) :: b -> ConstDeclare env r b -> ConstDeclare env r a # | |
(Monoid r, Monoid env) => Divisible (ConstDeclare env r) Source # | |
Defined in Jordan.OpenAPI.Internal divide :: (a -> (b, c)) -> ConstDeclare env r b -> ConstDeclare env r c -> ConstDeclare env r a # conquer :: ConstDeclare env r a # |
data PropertyDeclare Source #
Instances
addDescription :: Text -> Referenced Schema -> Referenced Schema Source #
newtype ObjectSchema a Source #
Instances
newtype TupleSchema a Source #
Instances
newtype JSONSchema a Source #
Instances
enumValues :: Schema -> [Value] Source #
combineSchemas :: Referenced Schema -> Referenced Schema -> Schema Source #
getJSONRef :: forall a. FromJSON a => Proxy a -> Declare (Definitions Schema) (Referenced Schema) Source #
getRefDef :: Declare (Definitions Schema) NamedSchema -> Declare (Definitions Schema) (Referenced Schema) Source #
onlyUnnamed :: Schema -> JSONSchema a Source #
encodeRefName :: Text -> Text Source #
getFromNamed :: forall a. FromJSON a => Proxy a -> Declare (Definitions Schema) NamedSchema Source #
Get documentation for a type that implements FromJSON
, in the Declare
environment.
This will be inline documention, IE, it will be named but not stored in the schema definitions.
getFromRef :: forall a. FromJSON a => Proxy a -> Declare (Definitions Schema) (Referenced Schema) Source #
Get documention for a type that implements FromJSON
.
This will store the type in the schemas key of the schema definitions, and give back a reference to it.
getToNamed :: forall a. ToJSON a => Proxy a -> Declare (Definitions Schema) NamedSchema Source #
Get documentation for a type that implements ToJSON
.
This will be inline documentation, IE, it will be named but not stored in the schema definitions.