module Wire.API.SwaggerServant
( OmitDocs,
)
where
import Data.Metrics.Servant
import Data.Proxy
import Imports hiding (head)
import Servant
import Servant.OpenApi (HasOpenApi (toOpenApi))
data OmitDocs
instance HasOpenApi (OmitDocs :> a) where
toOpenApi :: Proxy (OmitDocs :> a) -> OpenApi
toOpenApi Proxy (OmitDocs :> a)
_ = OpenApi
forall a. Monoid a => a
mempty
instance (HasServer api ctx) => HasServer (OmitDocs :> api) ctx where
type ServerT (OmitDocs :> api) m = ServerT api m
route :: forall env.
Proxy (OmitDocs :> api)
-> Context ctx
-> Delayed env (Server (OmitDocs :> api))
-> Router env
route Proxy (OmitDocs :> api)
_ = Proxy api
-> Context ctx
-> Delayed env (Server api)
-> Router' env RoutingApplication
forall env.
Proxy api -> Context ctx -> Delayed env (Server api) -> Router env
forall {k} (api :: k) (context :: [*]) env.
HasServer api context =>
Proxy api
-> Context context -> Delayed env (Server api) -> Router env
route (Proxy api
forall {k} (t :: k). Proxy t
Proxy :: Proxy api)
hoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy (OmitDocs :> api)
-> Proxy ctx
-> (forall x. m x -> n x)
-> ServerT (OmitDocs :> api) m
-> ServerT (OmitDocs :> api) n
hoistServerWithContext Proxy (OmitDocs :> api)
_ Proxy ctx
pc forall x. m x -> n x
nt ServerT (OmitDocs :> api) m
s =
Proxy api
-> Proxy ctx
-> (forall x. m x -> n x)
-> ServerT api m
-> ServerT api n
forall {k} (api :: k) (context :: [*]) (m :: * -> *) (n :: * -> *).
HasServer api context =>
Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> ServerT api m
-> ServerT api n
forall (m :: * -> *) (n :: * -> *).
Proxy api
-> Proxy ctx
-> (forall x. m x -> n x)
-> ServerT api m
-> ServerT api n
hoistServerWithContext (Proxy api
forall {k} (t :: k). Proxy t
Proxy :: Proxy api) Proxy ctx
pc m x -> n x
forall x. m x -> n x
nt ServerT api m
ServerT (OmitDocs :> api) m
s
instance (RoutesToPaths api) => RoutesToPaths (OmitDocs :> api) where
getRoutes :: Forest PathSegment
getRoutes = forall api. RoutesToPaths api => Forest PathSegment
forall {k} (routes :: k).
RoutesToPaths routes =>
Forest PathSegment
getRoutes @api