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
641
641
--
642
642
-- The way the object is constructed from the extracted fields can be controlled by
643
643
-- providing an instance on @'FromDeepQuery'@
644
- --
644
+ --
645
645
-- Example:
646
646
--
647
647
-- > type MyApi = "books" :> DeepQuery "filter" BookQuery :> Get '[JSON] [Book]
@@ -914,6 +914,13 @@ instance HasServer EmptyAPI context where
914
914
915
915
hoistServerWithContext _ _ _ = retag
916
916
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
+
917
924
-- | Basic Authentication
918
925
instance ( KnownSymbol realm
919
926
, HasServer api context
You can’t perform that action at this time.
0 commit comments