diff --git a/servant-client/src/Servant/Client.hs b/servant-client/src/Servant/Client.hs index 20bebba7..d4124118 100644 --- a/servant-client/src/Servant/Client.hs +++ b/servant-client/src/Servant/Client.hs @@ -125,10 +125,11 @@ instance (KnownSymbol capture, ToHttpApiData a, HasClient sublayout) instance (AuthenticateRequest authdata, HasClient sublayout) => HasClient (AuthProtect authdata (usr :: *) policy :> sublayout) where type Client (AuthProtect authdata usr policy :> sublayout) = authdata -> Client sublayout - clientWithRoute Proxy req baseurl val = + clientWithRoute Proxy req baseurl manager val = clientWithRoute (Proxy :: Proxy sublayout) (authReq val req) baseurl + manager -- | If you have a 'Delete' endpoint in your API, the client -- side querying function that is created when calling 'client' diff --git a/servant-client/test/Servant/ClientSpec.hs b/servant-client/test/Servant/ClientSpec.hs index 6b16819a..345cbb08 100644 --- a/servant-client/test/Servant/ClientSpec.hs +++ b/servant-client/test/Servant/ClientSpec.hs @@ -173,6 +173,7 @@ sucessSpec = beforeAll (startWaiApp server) $ afterAll endWaiApp $ do it "Servant.API.Get" $ \(_, baseUrl) -> do let getGet = getNth (Proxy :: Proxy 0) $ client api baseUrl manager + manager <- C.newManager C.defaultManagerSettings let getGet :: ExceptT ServantError IO Person getDeleteEmpty :: ExceptT ServantError IO () @@ -273,7 +274,7 @@ sucessSpec = beforeAll (startWaiApp server) $ afterAll endWaiApp $ do Right val -> getHeaders val `shouldBe` [("X-Example1", "1729"), ("X-Example2", "eg2")] it "Handles Authentication appropriatley" $ withServer $ \ _ -> do - (Arrow.left show <$> runExceptT (getPrivatePerson (BasicAuth "servant" "server"))) `shouldReturn` Right alice + (Control.Arrow.left show <$> runExceptT (getPrivatePerson (BasicAuth "servant" "server"))) `shouldReturn` Right alice it "returns 401 when not properly authenticated" $ do Left res <- runExceptT (getPrivatePerson (BasicAuth "xxx" "yyy")) diff --git a/servant-docs/example/greet.hs b/servant-docs/example/greet.hs index 569a5414..7d0f05a6 100644 --- a/servant-docs/example/greet.hs +++ b/servant-docs/example/greet.hs @@ -66,14 +66,14 @@ instance ToSample Greet where instance ToSample Int where toSamples _ = singleSample 1729 -instance ToSample User User where - toSample _ = Just (User "I'm a user!") +instance ToSample User where + toSamples _ = singleSample (User "I'm a user!") -instance ToSample Cookie Cookie where - toSample _ = Just (Cookie "cookie") +instance ToSample Cookie where + toSamples _ = singleSample (Cookie "cookie") -instance ToSample SecretData SecretData where - toSample _ = Just (SecretData "shhhhh!") +instance ToSample SecretData where + toSamples _ = singleSample (SecretData "shhhhh!") instance ToAuthInfo (AuthProtect Cookie User policy) where toAuthInfo _ = AuthenticationInfo "In this sentence we outline how authentication works." diff --git a/servant-docs/src/Servant/Docs.hs b/servant-docs/src/Servant/Docs.hs index 8e598837..323d8073 100644 --- a/servant-docs/src/Servant/Docs.hs +++ b/servant-docs/src/Servant/Docs.hs @@ -30,13 +30,12 @@ module Servant.Docs , DocOptions(..) , defaultDocOptions, maxSamples , -- * Classes you need to implement for your types -<<<<<<< HEAD ToSample(..) , toSample , noSamples , singleSample , samples - ToAuthInfo(..) + , ToAuthInfo(..) , sampleByteString , sampleByteStrings , ToParam(..) diff --git a/servant-docs/src/Servant/Docs/Internal.hs b/servant-docs/src/Servant/Docs/Internal.hs index 9f527c29..38764b6c 100644 --- a/servant-docs/src/Servant/Docs/Internal.hs +++ b/servant-docs/src/Servant/Docs/Internal.hs @@ -725,8 +725,8 @@ instance {-# OVERLAPPABLE #-} #endif ( HasDocs sublayout - , ToSample auth auth - , ToSample usr usr + , ToSample auth + , ToSample usr , ToAuthInfo (AuthProtect auth usr policy) ) => HasDocs (AuthProtect auth usr policy :> sublayout) where