Merge ebc7d40e70
into ad25e98e19
This commit is contained in:
commit
cf08a380f9
|
@ -868,7 +868,7 @@ instance HasStatus AnimalResponse where
|
|||
|
||||
type UVerbApi
|
||||
= "person" :> Capture "shouldRedirect" Bool :> UVerb 'GET '[JSON] '[PersonResponse, RedirectResponse]
|
||||
:<|> "animal" :> UVerb 'GET '[JSON] '[AnimalResponse]
|
||||
:<|> "animal" :> UVerb 'GET '[JSON] '[WithStatus 203 AnimalResponse]
|
||||
|
||||
uverbSpec :: Spec
|
||||
uverbSpec = describe "Servant.API.UVerb " $ do
|
||||
|
@ -883,7 +883,9 @@ uverbSpec = describe "Servant.API.UVerb " $ do
|
|||
personHandler True = respond $ RedirectResponse "over there!"
|
||||
personHandler False = respond $ PersonResponse joe
|
||||
|
||||
animalHandler = respond $ AnimalResponse mouse
|
||||
animalHandler :: Handler (Union '[WithStatus 203 AnimalResponse])
|
||||
animalHandler = respond $
|
||||
(WithStatus $ AnimalResponse mouse :: WithStatus 203 AnimalResponse)
|
||||
|
||||
server :: Server UVerbApi
|
||||
server = personHandler :<|> animalHandler
|
||||
|
|
Loading…
Reference in New Issue