Ubus lua service, cannot respond with array

I created a service written in lua using "https://lxr.openwrt.org/source/ubus/lua/" as an example.

I can respond with a table if it has string indexes, but not if they are integers (an array). I get "invalid key to 'next'".

Respond, as in "conn:reply(req, aTable)" and I can iterate through the array with 'pairs' or 'next' OK.

Additionally what does "{id = ubus.INT32, msg = ubus.STRING }" after the handler function mean?

Looks like that error is not well handled in the Lua binding but the ubus wire protocol only allows for table/dictionary/object responses. Array responses are not allowed.

This is the function policy, a table describing the parameters the function may receive, or in other word a "function signature". You can see it by running ubus -v list on the cli.