Close #1158, Add summary to OpenAPI doc for RPC functions (#1170)

This commit is contained in:
mdr1384
2018-08-27 10:22:21 -05:00
committed by Steve Chávez
parent 6907e7f979
commit dfa9055c34
4 changed files with 25 additions and 7 deletions
+14 -6
View File
@@ -221,13 +221,20 @@ spec = do
describe "RPC" $ do
it "includes body schema for arguments" $ do
it "includes function summary/description and body schema for arguments" $ do
r <- simpleBody <$> get "/"
let args = r ^? key "paths" . key "/rpc/varied_arguments"
. key "post" . key "parameters"
. nth 0 . key "schema"
liftIO $
let method s = key "paths" . key "/rpc/varied_arguments" . key s
args = r ^? method "post" . key "parameters" . nth 0 . key "schema"
summary = r ^? method "post" . key "summary"
description = r ^? method "post" . key "description"
liftIO $ do
summary `shouldBe` Just "An RPC function"
description `shouldBe` Just "Just a test for RPC function arguments"
args `shouldBe` Just
[aesonQQ|
{
@@ -269,7 +276,8 @@ spec = do
"type": "integer"
}
},
"type": "object"
"type": "object",
"description": "An RPC function\n\nJust a test for RPC function arguments"
}
|]
+4
View File
@@ -222,6 +222,10 @@ AS $_$
SELECT 'Hi'::text;
$_$;
COMMENT ON FUNCTION varied_arguments(double precision, character varying, boolean, date, money, enum_menagerie_type, integer) IS
$_$An RPC function
Just a test for RPC function arguments$_$;
--
-- Name: jwt_test(); Type: FUNCTION; Schema: test; Owner: -