webgear-openapi-1.0.2: Composable, type-safe library to build HTTP API servers
Safe HaskellNone
LanguageHaskell2010

WebGear.OpenApi.Handler

Description

An implementation of Handler to generate OpenApi documentation from WebGear API specifications.

Synopsis

Documentation

newtype OpenApiHandler m a b Source #

A handler that captured OpenApi documentation of API specifications.

Constructors

OpenApiHandler 

Instances

Instances details
ArrowError RouteMismatch (OpenApiHandler m :: Type -> Type -> Type) Source # 
Instance details

Defined in WebGear.OpenApi.Handler

Category (OpenApiHandler m :: k2 -> k2 -> Type) Source # 
Instance details

Defined in WebGear.OpenApi.Handler

Methods

id :: forall (a :: k). OpenApiHandler m a a #

(.) :: forall (b :: k) (c :: k) (a :: k). OpenApiHandler m b c -> OpenApiHandler m a b -> OpenApiHandler m a c #

ArrowChoice (OpenApiHandler m :: Type -> Type -> Type) Source # 
Instance details

Defined in WebGear.OpenApi.Handler

Methods

left :: OpenApiHandler m b c -> OpenApiHandler m (Either b d) (Either c d) #

right :: OpenApiHandler m b c -> OpenApiHandler m (Either d b) (Either d c) #

(+++) :: OpenApiHandler m b c -> OpenApiHandler m b' c' -> OpenApiHandler m (Either b b') (Either c c') #

(|||) :: OpenApiHandler m b d -> OpenApiHandler m c d -> OpenApiHandler m (Either b c) d #

Arrow (OpenApiHandler m :: Type -> Type -> Type) Source # 
Instance details

Defined in WebGear.OpenApi.Handler

Methods

arr :: (b -> c) -> OpenApiHandler m b c #

first :: OpenApiHandler m b c -> OpenApiHandler m (b, d) (c, d) #

second :: OpenApiHandler m b c -> OpenApiHandler m (d, b) (d, c) #

(***) :: OpenApiHandler m b c -> OpenApiHandler m b' c' -> OpenApiHandler m (b, b') (c, c') #

(&&&) :: OpenApiHandler m b c -> OpenApiHandler m b c' -> OpenApiHandler m b (c, c') #

ArrowZero (OpenApiHandler m :: Type -> Type -> Type) Source # 
Instance details

Defined in WebGear.OpenApi.Handler

Methods

zeroArrow :: OpenApiHandler m b c #

ArrowPlus (OpenApiHandler m :: Type -> Type -> Type) Source # 
Instance details

Defined in WebGear.OpenApi.Handler

Methods

(<+>) :: OpenApiHandler m b c -> OpenApiHandler m b c -> OpenApiHandler m b c #

Monad m => Handler (OpenApiHandler m :: Type -> Type -> Type) m Source # 
Instance details

Defined in WebGear.OpenApi.Handler

Get (OpenApiHandler m :: Type -> Type -> Type) Method Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Method

Get (OpenApiHandler m :: Type -> Type -> Type) PathEnd Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Path

Get (OpenApiHandler m :: Type -> Type -> Type) Path Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Path

Set (OpenApiHandler m :: Type -> Type -> Type) Status Response Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Status

ToSchema val => Get (OpenApiHandler m :: Type -> Type -> Type) (JSONBody val) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Body

Methods

getTrait :: forall (ts :: [Type]). JSONBody val -> OpenApiHandler m (Linked ts Request) (Either (Absence (JSONBody val) Request) (Attribute (JSONBody val) Request)) #

ToSchema val => Get (OpenApiHandler m :: Type -> Type -> Type) (Body val) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Body

Methods

getTrait :: forall (ts :: [Type]). Body val -> OpenApiHandler m (Linked ts Request) (Either (Absence (Body val) Request) (Attribute (Body val) Request)) #

ToSchema val => Set (OpenApiHandler m :: Type -> Type -> Type) (JSONBody val) Response Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Body

Methods

setTrait :: forall (ts :: [Type]). JSONBody val -> (Linked ts Response -> Response -> Attribute (JSONBody val) Response -> Linked (JSONBody val ': ts) Response) -> OpenApiHandler m (Linked ts Response, Attribute (JSONBody val) Response) (Linked (JSONBody val ': ts) Response) #

ToSchema val => Set (OpenApiHandler m :: Type -> Type -> Type) (Body val) Response Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Body

Methods

setTrait :: forall (ts :: [Type]). Body val -> (Linked ts Response -> Response -> Attribute (Body val) Response -> Linked (Body val ': ts) Response) -> OpenApiHandler m (Linked ts Response, Attribute (Body val) Response) (Linked (Body val ': ts) Response) #

(KnownSymbol tag, ToSchema val) => Get (OpenApiHandler m :: Type -> Type -> Type) (PathVar tag val) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Path

Methods

getTrait :: forall (ts :: [Type]). PathVar tag val -> OpenApiHandler m (Linked ts Request) (Either (Absence (PathVar tag val) Request) (Attribute (PathVar tag val) Request)) #

(KnownSymbol name, ToSchema val, TraitAbsence (Header 'Optional ps name val) Request) => Get (OpenApiHandler m :: Type -> Type -> Type) (Header 'Optional ps name val) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Header

Methods

getTrait :: forall (ts :: [Type]). Header 'Optional ps name val -> OpenApiHandler m (Linked ts Request) (Either (Absence (Header 'Optional ps name val) Request) (Attribute (Header 'Optional ps name val) Request)) #

(KnownSymbol name, ToSchema val, TraitAbsence (Header 'Required ps name val) Request) => Get (OpenApiHandler m :: Type -> Type -> Type) (Header 'Required ps name val) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Header

Methods

getTrait :: forall (ts :: [Type]). Header 'Required ps name val -> OpenApiHandler m (Linked ts Request) (Either (Absence (Header 'Required ps name val) Request) (Attribute (Header 'Required ps name val) Request)) #

(KnownSymbol name, ToSchema val, TraitAbsence (QueryParam 'Optional ps name val) Request) => Get (OpenApiHandler m :: Type -> Type -> Type) (QueryParam 'Optional ps name val) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.QueryParam

Methods

getTrait :: forall (ts :: [Type]). QueryParam 'Optional ps name val -> OpenApiHandler m (Linked ts Request) (Either (Absence (QueryParam 'Optional ps name val) Request) (Attribute (QueryParam 'Optional ps name val) Request)) #

(KnownSymbol name, ToSchema val, TraitAbsence (QueryParam 'Required ps name val) Request) => Get (OpenApiHandler m :: Type -> Type -> Type) (QueryParam 'Required ps name val) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.QueryParam

Methods

getTrait :: forall (ts :: [Type]). QueryParam 'Required ps name val -> OpenApiHandler m (Linked ts Request) (Either (Absence (QueryParam 'Required ps name val) Request) (Attribute (QueryParam 'Required ps name val) Request)) #

(KnownSymbol name, ToSchema val, Trait (Header 'Optional ps name val) Response) => Set (OpenApiHandler m :: Type -> Type -> Type) (Header 'Optional ps name val) Response Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Header

Methods

setTrait :: forall (ts :: [Type]). Header 'Optional ps name val -> (Linked ts Response -> Response -> Attribute (Header 'Optional ps name val) Response -> Linked (Header 'Optional ps name val ': ts) Response) -> OpenApiHandler m (Linked ts Response, Attribute (Header 'Optional ps name val) Response) (Linked (Header 'Optional ps name val ': ts) Response) #

(KnownSymbol name, ToSchema val, Trait (Header 'Required ps name val) Response) => Set (OpenApiHandler m :: Type -> Type -> Type) (Header 'Required ps name val) Response Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Header

Methods

setTrait :: forall (ts :: [Type]). Header 'Required ps name val -> (Linked ts Response -> Response -> Attribute (Header 'Required ps name val) Response -> Linked (Header 'Required ps name val ': ts) Response) -> OpenApiHandler m (Linked ts Response, Attribute (Header 'Required ps name val) Response) (Linked (Header 'Required ps name val ': ts) Response) #

(TraitAbsence (BasicAuth' x scheme m e a) Request, KnownSymbol scheme) => Get (OpenApiHandler m :: Type -> Type -> Type) (BasicAuth' x scheme m e a) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Auth.Basic

Methods

getTrait :: forall (ts :: [Type]). BasicAuth' x scheme m e a -> OpenApiHandler m (Linked ts Request) (Either (Absence (BasicAuth' x scheme m e a) Request) (Attribute (BasicAuth' x scheme m e a) Request)) #

(TraitAbsence (JWTAuth' x scheme m e a) Request, KnownSymbol scheme) => Get (OpenApiHandler m :: Type -> Type -> Type) (JWTAuth' x scheme m e a) Request Source # 
Instance details

Defined in WebGear.OpenApi.Trait.Auth.JWT

Methods

getTrait :: forall (ts :: [Type]). JWTAuth' x scheme m e a -> OpenApiHandler m (Linked ts Request) (Either (Absence (JWTAuth' x scheme m e a) Request) (Attribute (JWTAuth' x scheme m e a) Request)) #

data Tree a Source #

A tree where internal nodes have one or two children.

Instances

Instances details
Show a => Show (Tree a) Source # 
Instance details

Defined in WebGear.OpenApi.Handler

Methods

showsPrec :: Int -> Tree a -> ShowS #

show :: Tree a -> String #

showList :: [Tree a] -> ShowS #

singletonNode :: a -> Tree a Source #

Generate a tree with a single node

nullNode :: Tree a Source #

Generate an empty tree

toOpenApi :: OpenApiHandler m a b -> OpenApi Source #

Generate OpenApi documentation from a handler