Skip to content

Commit

Permalink
Add instance HasServer (EmptyAPI :> api) context
Browse files Browse the repository at this point in the history
  • Loading branch information
odr committed Aug 14, 2024
1 parent 45e031e commit a0834a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion servant-server/src/Servant/Server/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ instance
--
-- The way the object is constructed from the extracted fields can be controlled by
-- providing an instance on @'FromDeepQuery'@
--
--
-- Example:
--
-- > type MyApi = "books" :> DeepQuery "filter" BookQuery :> Get '[JSON] [Book]
Expand Down Expand Up @@ -914,6 +914,13 @@ instance HasServer EmptyAPI context where

hoistServerWithContext _ _ _ = retag

-- | Ignore @'EmptyAPI'@ as part of route in server handlers.
instance HasServer api context => HasServer (EmptyAPI :> api) context where
type ServerT (EmptyAPI :> api) m = ServerT api m

route _ = route (Proxy :: Proxy api)
hoistServerWithContext _ = hoistServerWithContext (Proxy :: Proxy api)

-- | Basic Authentication
instance ( KnownSymbol realm
, HasServer api context
Expand Down

0 comments on commit a0834a0

Please sign in to comment.