summaryrefslogtreecommitdiffstats
path: root/conf.d/controller
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-13 11:33:40 +0100
commitfd9b8c158b8542fc3daf654df2d936248ace76a6 (patch)
tree7d077e14d2c364a454e0563794a6a2fe8a65fe9e /conf.d/controller
parent57020f4e0ba8a92b362782b5642f1b1ee58f003c (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')
-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)