OpenAPI: Change GET response type to array (#1149)

This commit is contained in:
Alexey Alekhin
2018-07-24 12:26:45 -05:00
committed by Steve Chávez
parent 2b46afe1ec
commit 70e95649fd
3 changed files with 26 additions and 1 deletions
+21
View File
@@ -85,6 +85,27 @@ spec = do
deleteResponse `shouldBe` Just "No Content"
it "includes an array type for GET responses" $ do
r <- simpleBody <$> get "/"
let childGetSchema = r ^? key "paths"
. key "/child_entities"
. key "get"
. key "responses"
. key "200"
. key "schema"
liftIO $
childGetSchema `shouldBe` Just
[aesonQQ|
{
"items": {
"$ref": "#/definitions/child_entities"
},
"type": "array"
}
|]
it "includes definitions to tables" $ do
r <- simpleBody <$> get "/"