summaryrefslogtreecommitdiffstats
path: root/conf.d/controller/lua.d/aft.lua
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-12-04 12:28:30 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-11 17:42:06 +0000
commit61f3565dd9443fc77b39f9a8515db3672fb243e2 (patch)
treedf746099e55fff526dbd8c6157da57c9a921cdd2 /conf.d/controller/lua.d/aft.lua
parent1e4cc599b43091aa21cb8bb21660dab55bb124bc (diff)
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 <romain.forlot@iot.bzh>
Diffstat (limited to 'conf.d/controller/lua.d/aft.lua')
-rw-r--r--conf.d/controller/lua.d/aft.lua6
1 files changed, 5 insertions, 1 deletions
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)