Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog.d/1775
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
synopsis: Add instance `HasServer (EmptyAPI :> api) context`
prs: #1775
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