servant-swagger-ui-core-0.3.5: Servant swagger ui core components
Safe Haskell None
Language Haskell2010

Servant.Swagger.UI.Core

Synopsis

Swagger UI API

type SwaggerSchemaUI (dir :: Symbol ) (schema :: Symbol ) = SwaggerSchemaUI' dir (schema :> Get '[ JSON ] Value ) Source #

Swagger schema + ui api.

SwaggerSchemaUI "swagger-ui" "swagger.json" will result into following hierarchy:

/swagger.json
/swagger-ui
/swagger-ui/index.html
/swagger-ui/...

This type does not actually force served type to be Swagger from swagger2 package, it could be arbitrary aeson Value .

type SwaggerSchemaUI' (dir :: Symbol ) (api :: *) = api :<|> (dir :> ( Get '[ HTML ] ( SwaggerUiHtml dir api) :<|> (("index.html" :> Get '[ HTML ] ( SwaggerUiHtml dir api)) :<|> Raw ))) Source #

Use SwaggerSchemaUI' when you need even more control over where swagger.json is served (e.g. subdirectory).

Implementation details

data SwaggerUiHtml (dir :: Symbol ) (api :: *) Source #

Index file for swagger ui.

It's configured by the location of swagger schema and directory it lives under.

Implementation detail: the index.html is prepopulated with parameters to find schema file automatically.

swaggerSchemaUIServerImpl' :: Monad m => Text -> [( FilePath , ByteString )] -> ServerT api m -> ServerT ( SwaggerSchemaUI' dir api) m Source #

Use a custom server to serve the Swagger spec source.

data Handler a Source #

Instances

Instances details
Monad Handler
Instance details

Defined in Servant.Server.Internal.Handler

Functor Handler
Instance details

Defined in Servant.Server.Internal.Handler

MonadFail Handler
Instance details

Defined in Servant.Server.Internal.Handler

Applicative Handler
Instance details

Defined in Servant.Server.Internal.Handler

MonadIO Handler
Instance details

Defined in Servant.Server.Internal.Handler

MonadThrow Handler
Instance details

Defined in Servant.Server.Internal.Handler

MonadCatch Handler
Instance details

Defined in Servant.Server.Internal.Handler

MonadMask Handler
Instance details

Defined in Servant.Server.Internal.Handler

MonadBase IO Handler
Instance details

Defined in Servant.Server.Internal.Handler

MonadBaseControl IO Handler
Instance details

Defined in Servant.Server.Internal.Handler

Associated Types

type StM Handler a Source #

MonadError ServerError Handler
Instance details

Defined in Servant.Server.Internal.Handler

Generic ( Handler a)
Instance details

Defined in Servant.Server.Internal.Handler

Associated Types

type Rep ( Handler a) :: Type -> Type Source #

type StM Handler a
Instance details

Defined in Servant.Server.Internal.Handler

type Rep ( Handler a)
Instance details

Defined in Servant.Server.Internal.Handler

type Rep ( Handler a) = D1 (' MetaData "Handler" "Servant.Server.Internal.Handler" "servant-server-0.19.2-G0Z4CBXVk6K3TywlQVHRKg" ' True ) ( C1 (' MetaCons "Handler" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "runHandler'") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( ExceptT ServerError IO a))))