[Standards] Proposed XMPP Extension: Simple JSON Messaging

Marvin W xmpp at larma.de
Tue Feb 18 23:08:25 UTC 2020


The new XEP still uses the shortname "udt", has it in schema and also
mentions UDT in the §2.2, without there being any description of what it
means. I guess you just forgot to update those. This is likely to cause
confusion if left like this (especially the one in §2.2).

My only main critique that remains is that I fear using JSON inside XML
on wire can become normal the more we specify around it.

I also imagine that by going down this route, people will soon ask for
different notations like YAML (or TOML) to be supported.
If that happens we also need to answer the question if we want to be
able to convert between the different notations. And if we convert,
between notations, which notation goes on the wire?

Instead of allowing any of the three

> <payload xmlns="urn:xmpp:json-msg:0" datatype="urn:example:foo">
>     <json xmlns="urn:xmpp:json:0">
>         {
>             "a b": [
>                 { 
>                     "c": 1 
>                 }
>             ],
>             "d": "e",
>             "f": null,
>             "g": {}
>         }
>     </json>
> </payload>
> 
> <payload xmlns="urn:xmpp:yaml-msg:0" datatype="urn:example:foo">
>     <yaml xmlns="urn:xmpp:yaml:0">
>         a b:
>           - c: 1
>         d: e
>         f: null
>         g: {}
>     </yaml>
> </payload>
> 
> <payload xmlns="urn:xmpp:toml-msg:0" datatype="urn:example:foo">
>     <toml xmlns="urn:xmpp:toml:0">
>         d = "e"
> 
>         [g]
> 
>         [["a b"]]
>         c = 1.0
>     </toml>
> </payload>

we could just only go with something like

> <payload xmlns="urn:xmpp:object-msg:0" datatype="urn:example:foo">
>     <object xmlns="urn:example:xoml">
>         <list name="a b">
>             <object>
>                 <number name="c">1</number>
>             </object>
>         </list>
>         <string name="d">e</string>
>         <null name="f" />
>         <object name="g" />
>     </object>
> </payload>


and have the client side handle the conversion to
JSON/YAML/TOML/whatever. As this is all about people that don't
understand what happens on the wire, they also shouldn't care if it
really is JSON going over the wire, no?

Marvin

On 2/18/20 4:55 PM, Jonas Schäfer (XSF Editor) wrote:
> URL: https://xmpp.org/extensions/inbox/udt.html


More information about the Standards mailing list