Fix bad OpenAPI output when having functions with OUT/INOUT params

This commit is contained in:
steve-chavez
2017-10-09 10:45:17 -05:00
committed by Steve Chávez
parent e1cab584a3
commit 7a3f350f1c
3 changed files with 28 additions and 3 deletions
+16
View File
@@ -200,6 +200,22 @@ spec = do
liftIO $ funcTag `shouldBe` Just [aesonQQ|"(rpc) privileged_hello"|]
it "doesn't include OUT params of function as required parameters" $ do
r <- simpleBody <$> get "/"
let params = r ^? key "paths" . key "/rpc/many_out_params"
. key "post" . key "parameters" . nth 0
. key "schema". key "required"
liftIO $ params `shouldBe` Nothing
it "includes INOUT params(with no DEFAULT) of function as required parameters" $ do
r <- simpleBody <$> get "/"
let params = r ^? key "paths" . key "/rpc/many_inout_params"
. key "post" . key "parameters" . nth 0
. key "schema". key "required"
liftIO $ params `shouldBe` Just [aesonQQ|["num", "str"]|]
describe "Allow header" $ do
it "includes read/write verbs for writeable table" $ do