From 61f3565dd9443fc77b39f9a8515db3672fb243e2 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 4 Dec 2018 12:28:30 +0100 Subject: Handle more argument's type when making a subcall Calling an api's verb may require to use other things than a JSON object, so this add the possibility to use the other JSON types: string, number or boolean. Change-Id: If95aa35241ea3b11e88e82e7dbdd3e462b4f9eff Signed-off-by: Romain Forlot --- conf.d/controller/lua.d/aft.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf.d/controller/lua.d/aft.lua b/conf.d/controller/lua.d/aft.lua index 5b16bf3..971f8be 100644 --- a/conf.d/controller/lua.d/aft.lua +++ b/conf.d/controller/lua.d/aft.lua @@ -341,7 +341,11 @@ local function assertVerbCallParameters(src, api, verb, args) _AFT.assertIsUserdata(src, "Source must be an opaque userdata pointer which will be passed to the binder") _AFT.assertIsString(api, "API and Verb must be string") _AFT.assertIsString(verb, "API and Verb must be string") - _AFT.assertIsTrue( (type(args) == "table" or type(args) == "string"), "Arguments must use LUA Table or string (even empty)") + _AFT.assertIsTrue( (type(args) == "table" or + type(args) == "string" or + type(args) == "number" or + type(args) == "boolean"), "Arguments must use LUA Table, string, boolean or number" + ) end function _AFT.callVerb(api, verb, args) -- cgit 1.2.3-korg