On Fri, Jul 17, 2020 at 02:12:06PM +0200, Ladislav Lhotka wrote: > > > On 17. 07. 20 12:03, Vladimir Vassilev wrote: > > On 17/07/2020 09.11, Ladislav Lhotka wrote: > > > >> > >> On 17. 07. 20 8:57, Michal Vaško wrote: > >>> Hi Carsten, > >>> you had an interesting idea to have tools that could warn about these > >>> problems (although that is hardly a proper solution) but it is not > >>> really possible because the problem may occur whenever there is union > >>> with a 'string' and 'int8' - 'int32', 'uint8' - 'uint32', or > >>> 'boolean', in any order. Meaning in lots of, if not most, unions. And > >>> I have considered only XML and JSON, I have not looked into CBOR, > >>> which may make it even worse. > >> What you can do is to define a metadata annotation specifying the union > >> member for a particular instance, and implement it in your tools. This > >> would be a solution independent of instance representation. > > > > > > IMO this does not solve the problem that XML can not encode all values > > of the value space in certain awkward unions (JSON and CBOR can't do > > that either only the constraints are alternative supersets). > > Why not? In XML, everything is encoded as text, and the annotation tells > how to parse it and interpret. So either the text representation > conforms to that precise type or otherwise it is an error. There is no > ambiguity. >
An annotation that is only understood by some tools and not by others is creating a new problem since different tools now start to interpret data in different ways, i.e., the annotation harms interoperability. /js -- Juergen Schoenwaelder Jacobs University Bremen gGmbH Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany Fax: +49 421 200 3103 <https://www.jacobs-university.de/> _______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod