mod_rest/jsonmap.lib.lua
changeset 3890 b64b08b7bf8e
parent 3889 1ec45dbc7db5
child 3892 04ea96a0488d
--- a/mod_rest/jsonmap.lib.lua	Fri Feb 07 20:49:07 2020 +0100
+++ b/mod_rest/jsonmap.lib.lua	Fri Feb 07 20:53:57 2020 +0100
@@ -90,6 +90,14 @@
 };
 
 local simple_types = {
+	-- top level stanza attributes
+	-- needed here to mark them as known fields
+	kind = "attr",
+	type = "attr",
+	to = "attr",
+	from = "attr",
+	id = "attr",
+
 	-- basic message
 	body = "text_tag",
 	subject = "text_tag",
@@ -453,6 +461,8 @@
 		if typ then
 			if typ == "text_tag" then
 				s:text_tag(k, v);
+			elseif typ == "attr" then -- luacheck: ignore 542
+				-- handled already
 			elseif typ[1] == "text_tag" then
 				s:text_tag(typ[3] or k, v, typ[2] and { xmlns = typ[2] });
 			elseif typ[1] == "name" then