From 4f191a323991dcfd5dae3c7a0b68a0c83715625f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 20 Mar 2021 21:29:51 +0100 Subject: util.datamapper: Complete array building support --- teal-src/util/datamapper.tl | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'teal-src') diff --git a/teal-src/util/datamapper.tl b/teal-src/util/datamapper.tl index 2c1b05dc..75b65afd 100644 --- a/teal-src/util/datamapper.tl +++ b/teal-src/util/datamapper.tl @@ -323,18 +323,9 @@ function unparse ( schema : json_schema_object, t : table, current_name : string return out; elseif schema.type == "array" then - local proptype, value_where, name, namespace = unpack_propschema(schema.items, current_name, current_ns) - -- TODO , prefix, single_attribute - if proptype == "string" then - for _, item in ipairs(t as { string }) 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 as { string }) do + unparse_property(out, item, proptype, schema.items, value_where, name, namespace, current_ns, prefix, single_attribute) end return out; end -- cgit v1.2.3