This commit is contained in:
Intolerable 2022-11-08 13:25:11 +09:00 committed by GitHub
commit cf08a380f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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