# HG changeset patch # User Kim Alvefur # Date 1616517889 -3600 # Node ID b68b801ddc50b9171bf23ba99da81041279958e1 # Parent 9764d27db681653a31ae09797d5465cb8e8e7898 mod_rest: Restore 'kind' property in JSON-mapped objects The datamapper schema has no 'kind' field, instead handling it as a top-level property of the currently unused element and doing this early dispatch on the top level element name. This puts the field back into the output JSON. diff -r 9764d27db681 -r b68b801ddc50 mod_rest/jsonmap.lib.lua --- a/mod_rest/jsonmap.lib.lua Tue Mar 23 15:24:47 2021 +0100 +++ b/mod_rest/jsonmap.lib.lua Tue Mar 23 17:44:49 2021 +0100 @@ -408,6 +408,8 @@ local function st2json(s) local t = map.parse(schema.properties[s.name], s); + t.kind = s.name; + if s.name == "presence" and not s.attr.type then t.type = "available"; end