WIP: more comprehensive test of rpc args
Breaks toks2arg
This commit is contained in:
@@ -29,14 +29,14 @@ spec = do
|
|||||||
|
|
||||||
it "includes a representative function with parameters" $ do
|
it "includes a representative function with parameters" $ do
|
||||||
r <- simpleBody <$> get "/"
|
r <- simpleBody <$> get "/"
|
||||||
let ref = r ^? key "paths" . key "/rpc/login"
|
let ref = r ^? key "paths" . key "/rpc/varied_arguments"
|
||||||
. key "post" . key "parameters"
|
. key "post" . key "parameters"
|
||||||
. nth 0 . key "schema"
|
. nth 0 . key "schema"
|
||||||
. key "$ref" . _String
|
. key "$ref" . _String
|
||||||
login = r ^? key "definitions" . key "(rpc) login"
|
login = r ^? key "definitions" . key "(rpc) varied_arguments"
|
||||||
|
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
ref `shouldBe` Just "#/definitions/(rpc) login"
|
ref `shouldBe` Just "#/definitions/(rpc) varied_arguments"
|
||||||
login `shouldBe` Just
|
login `shouldBe` Just
|
||||||
[aesonQQ|
|
[aesonQQ|
|
||||||
{
|
{
|
||||||
|
|||||||
Vendored
+15
@@ -215,6 +215,21 @@ SELECT rolname::text, id::text FROM postgrest.auth WHERE id = id AND pass = pass
|
|||||||
$$;
|
$$;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE FUNCTION varied_arguments(
|
||||||
|
double double precision,
|
||||||
|
"varchar" character varying,
|
||||||
|
"boolean" boolean,
|
||||||
|
date date,
|
||||||
|
money money,
|
||||||
|
enum enum_menagerie_type,
|
||||||
|
"integer" integer default 42
|
||||||
|
) RETURNS text
|
||||||
|
LANGUAGE sql
|
||||||
|
AS $_$
|
||||||
|
SELECT 'Hi';
|
||||||
|
$_$;
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: jwt_test(); Type: FUNCTION; Schema: test; Owner: -
|
-- Name: jwt_test(); Type: FUNCTION; Schema: test; Owner: -
|
||||||
--
|
--
|
||||||
|
|||||||
Reference in New Issue
Block a user