Correct ReqBody instance for link generation. Was partially applied

This commit is contained in:
Christian Marie 2015-03-17 12:10:24 +11:00
parent 47a30c6411
commit 7d91e50fc7
2 changed files with 4 additions and 4 deletions

View file

@ -320,8 +320,8 @@ instance (KnownSymbol sym, HasLink sub)
k = symbolVal (Proxy :: Proxy sym) k = symbolVal (Proxy :: Proxy sym)
-- Misc instances -- Misc instances
instance HasLink sub => HasLink (ReqBody a :> sub) where instance HasLink sub => HasLink (ReqBody ct a :> sub) where
type MkLink (ReqBody a :> sub) = MkLink sub type MkLink (ReqBody ct a :> sub) = MkLink sub
toLink _ = toLink (Proxy :: Proxy sub) toLink _ = toLink (Proxy :: Proxy sub)
instance (ToText v, HasLink sub) instance (ToText v, HasLink sub)

View file

@ -29,7 +29,7 @@ type TestApi =
:<|> "raw" :> Raw :<|> "raw" :> Raw
type TestLink = "hello" :> "hi" :> Get '[JSON] Bool type TestLink = "hello" :> "hi" :> Get '[JSON] Bool
type TestLink2 = "greet" :> Post '[PlainText] Bool type TestLink2 = "greet" :> ReqBody '[JSON] [Int] :> Post '[PlainText] Bool
type TestLink3 = "parent" :> "child" :> Get '[JSON] String type TestLink3 = "parent" :> "child" :> Get '[JSON] String
type BadTestLink = "hallo" :> "hi" :> Get '[JSON] Bool type BadTestLink = "hallo" :> "hi" :> Get '[JSON] Bool