diff options
author | Kim Alvefur <zash@zash.se> | 2021-03-20 21:29:51 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-03-20 21:29:51 +0100 |
commit | 4f191a323991dcfd5dae3c7a0b68a0c83715625f (patch) | |
tree | 42a1bee41dc8ca1ff0a8c205ec3a38dc574bee79 /util | |
parent | 366edae2398710b57e4febd8101b238eff414e57 (diff) | |
download | prosody-4f191a323991dcfd5dae3c7a0b68a0c83715625f.tar.gz prosody-4f191a323991dcfd5dae3c7a0b68a0c83715625f.zip |
util.datamapper: Complete array building support
Diffstat (limited to 'util')
-rw-r--r-- | util/datamapper.lua | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/util/datamapper.lua b/util/datamapper.lua index 66e3fe7b..65fa8e36 100644 --- a/util/datamapper.lua +++ b/util/datamapper.lua @@ -290,18 +290,9 @@ function unparse(schema, t, current_name, current_ns, ctx) return out elseif schema.type == "array" then - local proptype, value_where, name, namespace = unpack_propschema(schema.items, current_name, current_ns) - - if proptype == "string" then - for _, item in ipairs(t) do - if value_where == "in_text_tag" then - out:text_tag(name, item, {xmlns = namespace}); - else - error("NYI") - end - end - else - error("NYI") + local proptype, value_where, name, namespace, prefix, single_attribute = unpack_propschema(schema.items, current_name, current_ns) + for _, item in ipairs(t) do + unparse_property(out, item, proptype, schema.items, value_where, name, namespace, current_ns, prefix, single_attribute) end return out end |