# HG changeset patch # User Kim Alvefur # Date 1582374958 -3600 # Node ID 14a32224900c104db1c64da7b3cb53471fc57d07 # Parent 3f20b7c88afbde72fb498b71d79d67f8db0899fa mod_rest: Rename table of mappings The later items aren't very simple. diff -r 3f20b7c88afb -r 14a32224900c mod_rest/jsonmap.lib.lua --- 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);