<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://hg.omfa.de/prosody-hg/</link>
    <language>en-us</language>

    <title>prosody-hg: util/datamapper.lua history</title>
    <description>util/datamapper.lua revision history</description>
    <item>
    <title>teal: Regenerate Lua files</title>
    <link>http://hg.omfa.de/prosody-hg/log/b713da7527d2/util/datamapper.lua</link>
    <description><![CDATA[teal: Regenerate Lua files]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Fri, 09 May 2025 00:50:36 +0200</pubDate>
</item>
<item>
    <title>util: Prefix module imports with prosody namespace</title>
    <link>http://hg.omfa.de/prosody-hg/log/d10957394a3c/util/datamapper.lua</link>
    <description><![CDATA[util: Prefix module imports with prosody namespace]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Fri, 17 Mar 2023 16:23:16 +0100</pubDate>
</item>
<item>
    <title>util.mathcompat: Module to ease reuse of math.type()</title>
    <link>http://hg.omfa.de/prosody-hg/log/8815d3090928/util/datamapper.lua</link>
    <description><![CDATA[util.mathcompat: Module to ease reuse of math.type()<br/>
<br/>
Mostly to ensure it is available during tests, as util.startup is not<br/>
invoked there]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Thu, 20 Oct 2022 16:50:12 +0200</pubDate>
</item>
<item>
    <title>util.datamapper: Improve handling of schemas with non-obvious &quot;type&quot;</title>
    <link>http://hg.omfa.de/prosody-hg/log/a9dbf657c894/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Improve handling of schemas with non-obvious &quot;type&quot;<br/>
<br/>
The JSON Schema specification says that schemas are objects or booleans,<br/>
and that the 'type' property is optional and can be an array.<br/>
<br/>
This module previously allowed bare type names as schemas and did not<br/>
really handle booleans.<br/>
<br/>
It now handles missing 'type' properties and boolean 'true' as a schema.<br/>
Objects and arrays are guessed based on the presence of 'properties' or<br/>
'items' field.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Fri, 08 Jul 2022 17:32:48 +0200</pubDate>
</item>
<item>
    <title>util.datamapper: Add support for $ref pointers</title>
    <link>http://hg.omfa.de/prosody-hg/log/11060c8919b6/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Add support for $ref pointers<br/>
<br/>
Allows reuse of repetitive definitions in schemas.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Wed, 29 Dec 2021 17:57:09 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Don't include empty unwrapped arrays</title>
    <link>http://hg.omfa.de/prosody-hg/log/b2f9782497dd/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Don't include empty unwrapped arrays<br/>
<br/>
Since there is no way to distinguish an empty such array from a<br/>
zero-length array. Dropping it seems like the least annoying thing to<br/>
do.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Wed, 24 Mar 2021 00:48:02 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Fix error on attempt to coerce nil to something</title>
    <link>http://hg.omfa.de/prosody-hg/log/377a9eaf7bef/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Fix error on attempt to coerce nil to something<br/>
<br/>
Turns falsy values into nil instead of nothing, which ensures this<br/>
function always has 1 return value, or table.insert({}) complains. Would<br/>
still happen on some unexpected input, but that's actually a good thing.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Tue, 23 Mar 2021 23:55:33 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Deal with locally built stanzas missing xmlns</title>
    <link>http://hg.omfa.de/prosody-hg/log/83e127eb91f9/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Deal with locally built stanzas missing xmlns<br/>
<br/>
So the problem is that xmlns is not inherited when building a stanza,<br/>
and then :get_child(n, ns) with an explicit namespace does not find that<br/>
such child tags.<br/>
<br/>
E.g.<br/>
local t = st.stanza(&quot;foo&quot;, { xmlns = &quot;urn:example:bar&quot; })<br/>
	:text_tag(&quot;hello&quot;, &quot;world&quot;);<br/>
assert(t:get_child(&quot;hello&quot;, &quot;urn:example:bar&quot;), &quot;This fails&quot;);<br/>
<br/>
Meanwhile, during parsing (util.xmppstream or util.xml) child tags do<br/>
get the parents xmlns when not overriding them.<br/>
<br/>
Thus, in the above example, if the stanza is passed trough<br/>
`t = util.xml.parse(tostring(t))` then the assert succeeds.<br/>
<br/>
This change makes it so that it leaves out the namespace argument to<br/>
:get_child when it is the same as the current/parent namespace, which<br/>
behaves the same for both built and parsed stanzas.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Tue, 23 Mar 2021 19:52:59 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Factor out conversion from any value to XML string</title>
    <link>http://hg.omfa.de/prosody-hg/log/9bd36e871f05/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Factor out conversion from any value to XML string<br/>
<br/>
Since this was the last severely duplicated code left.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Mon, 22 Mar 2021 22:24:39 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Handle nested arrays or objects in arrays</title>
    <link>http://hg.omfa.de/prosody-hg/log/ab03de8e503e/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Handle nested arrays or objects in arrays]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Mon, 22 Mar 2021 10:05:41 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Fix to skip parsing wrapped arrays that aren't there</title>
    <link>http://hg.omfa.de/prosody-hg/log/5ebad952ebf7/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Fix to skip parsing wrapped arrays that aren't there<br/>
<br/>
Turns out the unreachable error is reachable :D]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Mon, 22 Mar 2021 10:03:32 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Complete array building support</title>
    <link>http://hg.omfa.de/prosody-hg/log/348b191cd850/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Complete array building support]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sat, 20 Mar 2021 21:29:51 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Factor out handling of object properties for array reuse</title>
    <link>http://hg.omfa.de/prosody-hg/log/88792dd2bee9/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Factor out handling of object properties for array reuse]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sat, 20 Mar 2021 21:25:45 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Finally implement support for parsing arrays</title>
    <link>http://hg.omfa.de/prosody-hg/log/c098d07e6717/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Finally implement support for parsing arrays]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sat, 20 Mar 2021 20:45:06 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Factor out extraction of the XML part to use</title>
    <link>http://hg.omfa.de/prosody-hg/log/19a88b61ab4e/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Factor out extraction of the XML part to use<br/>
<br/>
So extract_value() takes an XML tag and details about which part we're<br/>
interested in and returns that.<br/>
<br/>
Factoring this out will help with array implementation since this will<br/>
be common behavior.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sat, 20 Mar 2021 19:02:18 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Only get element name if there's an element</title>
    <link>http://hg.omfa.de/prosody-hg/log/6e25409fecbd/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Only get element name if there's an element<br/>
<br/>
Fixes error due to attempting to index a nil value]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Fri, 19 Mar 2021 19:07:25 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Fix arrays nesting one level too deep</title>
    <link>http://hg.omfa.de/prosody-hg/log/d1982b7eb00d/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Fix arrays nesting one level too deep]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Fri, 19 Mar 2021 01:17:59 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Deal with type name changes in util.jsonschema</title>
    <link>http://hg.omfa.de/prosody-hg/log/766b0eddd12c/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Deal with type name changes in util.jsonschema]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Fri, 19 Mar 2021 00:26:04 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Limited support for unparsing simple arrays of strings</title>
    <link>http://hg.omfa.de/prosody-hg/log/0e00fa518688/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Limited support for unparsing simple arrays of strings]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Thu, 18 Mar 2021 13:07:10 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Add initial support for parsing arrays</title>
    <link>http://hg.omfa.de/prosody-hg/log/6a51749af7f4/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Add initial support for parsing arrays]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Thu, 18 Mar 2021 12:57:25 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Factor out common schema unpacking</title>
    <link>http://hg.omfa.de/prosody-hg/log/4e376a43fe40/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Factor out common schema unpacking<br/>
<br/>
This code extracts the bits from the schema that determines how the data<br/>
is to be mapped to/from XML.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sun, 14 Mar 2021 16:50:49 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Separate extraction of xml from coercion to target type</title>
    <link>http://hg.omfa.de/prosody-hg/log/a5050e21ab08/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Separate extraction of xml from coercion to target type<br/>
<br/>
Now it gets the text, attribute or name first, then turns it into<br/>
whatever the schema wants. This should be easier to further factor out<br/>
into preparation for array support.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sun, 14 Mar 2021 03:06:37 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Use enum instead of mutually exclusive booleans</title>
    <link>http://hg.omfa.de/prosody-hg/log/1d9c1893cc5e/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Use enum instead of mutually exclusive booleans<br/>
<br/>
Cleaner and rules out invalid combinations.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sun, 14 Mar 2021 01:57:00 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Enumerated elements</title>
    <link>http://hg.omfa.de/prosody-hg/log/f0037234b2e9/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Enumerated elements<br/>
<br/>
E.g. error conditions or chat states.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Fri, 12 Mar 2021 01:33:15 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Add references with notes</title>
    <link>http://hg.omfa.de/prosody-hg/log/ee4f2296e7df/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Add references with notes]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Wed, 10 Mar 2021 00:19:38 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Add support for mapping of elements where only one attribute matters</title>
    <link>http://hg.omfa.de/prosody-hg/log/9abcdfdcdb01/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Add support for mapping of elements where only one attribute matters<br/>
<br/>
E.g. &lt;feature var='foo'/&gt; in XEP-0030 and some other simple<br/>
specifications.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sun, 07 Mar 2021 12:48:49 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Add logic for &quot;boolean&quot; tags here the presence means true</title>
    <link>http://hg.omfa.de/prosody-hg/log/b7807583de34/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Add logic for &quot;boolean&quot; tags here the presence means true]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sun, 07 Mar 2021 01:41:39 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Invent extension for using tag name as value</title>
    <link>http://hg.omfa.de/prosody-hg/log/87a684df4b65/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Invent extension for using tag name as value<br/>
<br/>
Useful for certain enum-like uses where the element name is the relevant<br/>
information, e.g. chat states.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sat, 06 Mar 2021 23:14:23 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Add 'unparse' for turning tables into XML</title>
    <link>http://hg.omfa.de/prosody-hg/log/5df9ffc25bb4/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Add 'unparse' for turning tables into XML]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sun, 07 Mar 2021 00:57:36 +0100</pubDate>
</item>
<item>
    <title>util.datamapper: Library for extracting data from stanzas</title>
    <link>http://hg.omfa.de/prosody-hg/log/a1fa6202fa13/util/datamapper.lua</link>
    <description><![CDATA[util.datamapper: Library for extracting data from stanzas<br/>
<br/>
Based on the XML support in the OpenAPI specification.]]></description>
    <author>&#75;&#105;&#109;&#32;&#65;&#108;&#118;&#101;&#102;&#117;&#114;&#32;&#60;&#122;&#97;&#115;&#104;&#64;&#122;&#97;&#115;&#104;&#46;&#115;&#101;&#62;</author>
    <pubDate>Sun, 07 Mar 2021 00:57:36 +0100</pubDate>
</item>

  </channel>
</rss>
