{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module Servant.Swagger.UI.ReDoc (
SwaggerSchemaUI,
SwaggerSchemaUI',
redocSchemaUIServer,
redocSchemaUIServer',
redocIndexTemplate,
redocFiles
) where
import Servant.Swagger.UI.Core
import Data.ByteString (ByteString)
import Data.Swagger (Swagger)
import Data.Text (Text)
import FileEmbedLzma
import Servant
redocSchemaUIServer
:: (Server api ~ Handler Swagger)
=> Swagger -> Server (SwaggerSchemaUI' dir api)
redocSchemaUIServer =
swaggerSchemaUIServerImpl redocIndexTemplate redocFiles
redocSchemaUIServer'
:: Server api -> Server (SwaggerSchemaUI' dir api)
redocSchemaUIServer' =
swaggerSchemaUIServerImpl' redocIndexTemplate redocFiles
redocIndexTemplate :: Text
redocIndexTemplate = $(embedText "redoc.index.html.tmpl")
redocFiles :: [(FilePath, ByteString)]
redocFiles = $(embedRecursiveDir "redoc-dist-1.22.2")