Software /
code /
prosody-modules
Diff
mod_rest/jsonmap.lib.lua @ 3894:14a32224900c
mod_rest: Rename table of mappings
The later items aren't very simple.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 22 Feb 2020 13:35:58 +0100 |
parent | 3889:59765d1bb6dc |
child | 3895:25a3ad36ef3e |
line wrap: on
line diff
--- a/mod_rest/jsonmap.lib.lua Mon Feb 17 21:50:55 2020 +0100 +++ b/mod_rest/jsonmap.lib.lua Sat Feb 22 13:35:58 2020 +0100 @@ -105,7 +105,7 @@ return form; end -local simple_types = { +local field_mappings = { -- top level stanza attributes -- needed here to mark them as known fields kind = "attr", @@ -411,7 +411,7 @@ return t; end - for k, typ in pairs(simple_types) do + for k, typ in pairs(field_mappings) do if typ == "text_tag" then t[k] = s:get_child_text(k); elseif typ[1] == "text_tag" then @@ -487,7 +487,7 @@ end for k, v in pairs(t) do - local typ = simple_types[k]; + local typ = field_mappings[k]; if typ then if typ == "text_tag" then s:text_tag(k, v);