servant-swagger-1.1.3.1: Generate Swagger specification for your servant API.

License | BSD3
Maintainer | Nickolay Kudasov <nickolay@getshoptv.com>
Stability | experimental
Safe Haskell | None
Language | Haskell2010

Servant.Swagger.TypeLevel

Description

Useful type families for servant APIs.

Synopsis

- type family IsSubAPI sub api :: Constraint where ...
- type family EndpointsList api where ...
- type BodyTypes c api = Nub (BodyTypes' c api)

# Documentation

type family IsSubAPI sub api :: Constraint where ... #

Check whether `sub` is a sub API of `api`.

Equations

IsSubAPI sub api = AllIsElem (EndpointsList sub) api |

type family EndpointsList api where ... #

Build a list of endpoints from an API.

Equations

EndpointsList (a :<|> b) = AppendList (EndpointsList a) (EndpointsList b) |
EndpointsList (e :> a) = MapSub e (EndpointsList a) |
EndpointsList a = '[a] |

type BodyTypes c api = Nub (BodyTypes' c api) #

Extract a list of unique "body" types for a specific content-type from a servant API.