On 17. 07. 20 14:42, Juergen Schoenwaelder wrote: > 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.
I agree, it should eventually be standardized, if it turns out to be a good idea. But to find out, experience with running code always helps. Lada > > /js > -- Ladislav Lhotka Head, CZ.NIC Labs PGP Key ID: 0xB8F92B08A9F76C67 _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
