servant-checked-exceptions-core-2.2.0.1: Checked exceptions for Servant APIs.
CopyrightDennis Gosnell 2017
LicenseBSD3
MaintainerDennis Gosnell (cdep.illabout@gmail.com)
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Servant.Checked.Exceptions.Internal.Servant.Docs

Description

This module exports HasDocs instances for Throws and Throwing.

Synopsis

Documentation

class CreateRespBodiesFor list ctypes where Source #

Create samples for a given list of types, under given ctypes.

Additional instances of this class should not need to be created.

Methods

createRespBodiesFor :: Proxy list -> Proxy ctypes -> [(Text, MediaType, ByteString)] Source #

Instances

Instances details
CreateRespBodiesFor ('[] :: [k2]) (ctypes :: k1) Source #

An empty list of types has no samples.

Instance details

Defined in Servant.Checked.Exceptions.Internal.Servant.Docs

Methods

createRespBodiesFor :: Proxy '[] -> Proxy ctypes -> [(Text, MediaType, ByteString)] Source #

(AllMimeRender ctypes (Envelope '[e] ()), CreateRespBodiesFor es ctypes, ToSample e) => CreateRespBodiesFor (e ': es :: [Type]) (ctypes :: [Type]) Source #

Create a response body for each of the error types.

Instance details

Defined in Servant.Checked.Exceptions.Internal.Servant.Docs

Methods

createRespBodiesFor :: Proxy (e ': es) -> Proxy ctypes -> [(Text, MediaType, ByteString)] Source #

createRespBodyFor :: forall e ctypes. (AllMimeRender ctypes (Envelope '[e] ()), ToSample e) => Proxy e -> Proxy ctypes -> [(Text, MediaType, ByteString)] Source #

Create a sample for a given e under given ctypes.

Orphan instances

HasDocs (Throwing (Snoc es e) :> api) => HasDocs (Throwing es :> (Throws e :> api) :: Type) Source #

When a Throws e comes immediately after a Throwing es, Snoc the e onto the es.

Instance details

Methods

docsFor :: Proxy (Throwing es :> (Throws e :> api)) -> (Endpoint, Action) -> DocOptions -> API #

(CreateRespBodiesFor es ctypes, HasDocs (Verb method status ctypes (Envelope es a))) => HasDocs (Throwing es :> Verb method status ctypes a :: Type) Source #

When Throwing es comes before a Verb, generate the documentation for the same Verb, but returning an Envelope es. Also add documentation for the potential es.

Instance details

Methods

docsFor :: Proxy (Throwing es :> Verb method status ctypes a) -> (Endpoint, Action) -> DocOptions -> API #

HasDocs (Verb method status ctypes (Envelope ('[] :: [Type]) a)) => HasDocs (NoThrow :> Verb method status ctypes a :: Type) Source #

When NoThrow comes before a Verb, generate the documentation for the same Verb, but returning an Envelope '[].

Instance details

Methods

docsFor :: Proxy (NoThrow :> Verb method status ctypes a) -> (Endpoint, Action) -> DocOptions -> API #

HasDocs (Throwing '[e] :> api) => HasDocs (Throws e :> api :: Type) Source #

Change a Throws into Throwing.

Instance details

Methods

docsFor :: Proxy (Throws e :> api) -> (Endpoint, Action) -> DocOptions -> API #

ToSample a => ToSample (Envelope es a) Source #

We can generate a sample of an Envelope es a as long as there is a way to generate a sample of the a.

This doesn't need to worry about generating a sample of es, because that is taken care of in the HasDocs instance for Throwing es.

Instance details

Methods

toSamples :: Proxy (Envelope es a) -> [(Text, Envelope es a)] #