# HG changeset patch # User Kim Alvefur # Date 1616542462 -3600 # Node ID 0aa2971380e9ffac31d3983779c58c8099f5520f # Parent 377a9eaf7bef80c0f18f928c3c7c310bbbeb4c38 util.datamapper: Add test coverage of unwrapped arrays of objects Should the xml name/ns go on the array or the items schema? The later apparently. diff -r 377a9eaf7bef -r 0aa2971380e9 spec/util_datamapper_spec.lua --- a/spec/util_datamapper_spec.lua Tue Mar 23 23:55:33 2021 +0100 +++ b/spec/util_datamapper_spec.lua Wed Mar 24 00:34:22 2021 +0100 @@ -57,6 +57,17 @@ reactions = {type = "array"; items = {type = "string"; xml = {name = "reaction"}}}; }; }; + stanza_ids = { + type = "array"; + items = { + xml = {name = "stanza-id"; namespace = "urn:xmpp:sid:0"}; + type = "object"; + properties = { + id = {xml = {attribute = true}; type = "string"}; + by = {xml = {attribute = true}; type = "string"}; + }; + }; + }; }; }; @@ -68,6 +79,8 @@ + + 👋 🐢 @@ -86,6 +99,7 @@ state = "active"; fallback = true; origin_id = "qgkmMdPB"; + stanza_ids = {{id = "abc1"; by = "muc"}; {id = "xyz2"; by = "host"}}; react = { to = "744f6e18-a57a-11e9-a656-4889e7820c76"; reactions = {