File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
servant-server/src/Servant/Server Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1+ synopsis: Add instance `HasServer (EmptyAPI :> api) context`
2+ prs: #1775
Original file line number Diff line number Diff line change @@ -641,7 +641,7 @@ instance
641641--
642642-- The way the object is constructed from the extracted fields can be controlled by
643643-- providing an instance on @'FromDeepQuery'@
644- --
644+ --
645645-- Example:
646646--
647647-- > type MyApi = "books" :> DeepQuery "filter" BookQuery :> Get '[JSON] [Book]
@@ -914,6 +914,13 @@ instance HasServer EmptyAPI context where
914914
915915 hoistServerWithContext _ _ _ = retag
916916
917+ -- | Ignore @'EmptyAPI'@ as part of route in server handlers.
918+ instance HasServer api context => HasServer (EmptyAPI :> api ) context where
919+ type ServerT (EmptyAPI :> api ) m = ServerT api m
920+
921+ route _ = route (Proxy :: Proxy api )
922+ hoistServerWithContext _ = hoistServerWithContext (Proxy :: Proxy api )
923+
917924-- | Basic Authentication
918925instance ( KnownSymbol realm
919926 , HasServer api context
You can’t perform that action at this time.
0 commit comments