Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type SwaggerSchemaUI (dir :: Symbol) (schema :: Symbol) = SwaggerSchemaUI' dir (schema :> Get '[JSON] Swagger)
- type SwaggerSchemaUI' (dir :: Symbol) (api :: *) = api :<|> (dir :> (Get '[HTML] (SwaggerUiHtml dir api) :<|> (("index.html" :> Get '[HTML] (SwaggerUiHtml dir api)) :<|> Raw)))
- data SwaggerUiHtml (dir :: Symbol) (api :: *) = SwaggerUiHtml Text
- swaggerSchemaUIServerImpl :: Server api ~ Handler Swagger => Text -> [(FilePath, ByteString)] -> Swagger -> Server (SwaggerSchemaUI' dir api)
- swaggerSchemaUIServerImpl' :: Text -> [(FilePath, ByteString)] -> Server api -> Server (SwaggerSchemaUI' dir api)
- data Handler a
Swagger UI API
type SwaggerSchemaUI (dir :: Symbol) (schema :: Symbol) = SwaggerSchemaUI' dir (schema :> Get '[JSON] Swagger) 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/...
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.
Instances
(KnownSymbol dir, HasLink api, Link ~ MkLink api Link, IsElem api api) => ToMarkup (SwaggerUiHtml dir api) Source # | |
Defined in Servant.Swagger.UI.Core toMarkup :: SwaggerUiHtml dir api -> Markup # preEscapedToMarkup :: SwaggerUiHtml dir api -> Markup # |
swaggerSchemaUIServerImpl :: Server api ~ Handler Swagger => Text -> [(FilePath, ByteString)] -> Swagger -> Server (SwaggerSchemaUI' dir api) Source #
swaggerSchemaUIServerImpl' :: Text -> [(FilePath, ByteString)] -> Server api -> Server (SwaggerSchemaUI' dir api) Source #
Use a custom server to serve the Swagger spec source.
Instances
Monad Handler | |
Functor Handler | |
Applicative Handler | |
MonadIO Handler | |
Defined in Servant.Server.Internal.Handler | |
MonadThrow Handler | |
Defined in Servant.Server.Internal.Handler | |
MonadCatch Handler | |
MonadMask Handler | |
Defined in Servant.Server.Internal.Handler | |
MonadError ServerError Handler | |
Defined in Servant.Server.Internal.Handler throwError :: ServerError -> Handler a # catchError :: Handler a -> (ServerError -> Handler a) -> Handler a # | |
MonadBase IO Handler | |
Defined in Servant.Server.Internal.Handler | |
MonadBaseControl IO Handler | |
Generic (Handler a) | |
type StM Handler a | |
Defined in Servant.Server.Internal.Handler | |
type Rep (Handler a) | |
Defined in Servant.Server.Internal.Handler type Rep (Handler a) = D1 (MetaData "Handler" "Servant.Server.Internal.Handler" "servant-server-0.16-LHBku0bI2CMKMstjDwhIQk" True) (C1 (MetaCons "Handler" PrefixI True) (S1 (MetaSel (Just "runHandler'") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (ExceptT ServerError IO a)))) |