Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type SwaggerSchemaUI (dir :: Symbol ) (schema :: Symbol ) = SwaggerSchemaUI' dir (schema :> Get '[ JSON ] Value )
- 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 :: ( Monad m, ServerT api m ~ m Value , ToJSON a) => Text -> [( FilePath , ByteString )] -> a -> ServerT ( SwaggerSchemaUI' dir api) m
- swaggerSchemaUIServerImpl' :: Monad m => Text -> [( FilePath , ByteString )] -> ServerT api m -> ServerT ( SwaggerSchemaUI' dir api) m
- data Handler a
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.
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 Source # preEscapedToMarkup :: SwaggerUiHtml dir api -> Markup Source # |
swaggerSchemaUIServerImpl :: ( Monad m, ServerT api m ~ m Value , ToJSON a) => Text -> [( FilePath , ByteString )] -> a -> ServerT ( SwaggerSchemaUI' dir api) m Source #
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.
Instances
Monad Handler | |
Functor Handler | |
MonadFail Handler | |
Applicative Handler | |
Defined in Servant.Server.Internal.Handler |
|
MonadIO Handler | |
MonadThrow Handler | |
MonadCatch Handler | |
MonadMask Handler | |
Defined in Servant.Server.Internal.Handler |
|
MonadBase IO Handler | |
MonadBaseControl IO Handler | |
MonadError ServerError Handler | |
Defined in Servant.Server.Internal.Handler throwError :: ServerError -> Handler a Source # catchError :: Handler a -> ( ServerError -> Handler a) -> Handler a Source # |
|
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.19.2-G0Z4CBXVk6K3TywlQVHRKg" '
True
) (
C1
('
MetaCons
"Handler" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"runHandler'") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
(
ExceptT
ServerError
IO
a))))
|