Re: [netmod] JSON to XML lossy conversion

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Fri, 17 July 2020 12:42 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0F5EE3A0B31 for <netmod@ietfa.amsl.com>; Fri, 17 Jul 2020 05:42:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g6gZ2e3H7kC1 for <netmod@ietfa.amsl.com>; Fri, 17 Jul 2020 05:42:34 -0700 (PDT)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E10583A0B30 for <netmod@ietf.org>; Fri, 17 Jul 2020 05:42:32 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id 38D5D87F; Fri, 17 Jul 2020 14:42:31 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.198]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id 6NAXSR5R4IQ9; Fri, 17 Jul 2020 14:42:30 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "DFN-Verein Global Issuing CA" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Fri, 17 Jul 2020 14:42:30 +0200 (CEST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by hermes.jacobs-university.de (Postfix) with ESMTP id CAC3120154; Fri, 17 Jul 2020 14:42:30 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10028) with ESMTP id WDr9UdPMHsz4; Fri, 17 Jul 2020 14:42:30 +0200 (CEST)
Received: from localhost (anna.jacobs.jacobs-university.de [10.50.218.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by hermes.jacobs-university.de (Postfix) with ESMTPS id 75F01200E4; Fri, 17 Jul 2020 14:42:30 +0200 (CEST)
Date: Fri, 17 Jul 2020 14:42:28 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Ladislav Lhotka <ladislav.lhotka@nic.cz>
Cc: Vladimir Vassilev <vladimir@lightside-instruments.com>, "netmod@ietf.org" <netmod@ietf.org>
Message-ID: <20200717124228.dlds6cagrwjdzcrh@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Ladislav Lhotka <ladislav.lhotka@nic.cz>, Vladimir Vassilev <vladimir@lightside-instruments.com>, "netmod@ietf.org" <netmod@ietf.org>
References: <1da7-5f114c00-115-50d47000@26535751> <2a3fe9be-9319-2f19-e18d-be723379953f@nic.cz> <ec0176fd-7b37-f356-825a-c90e86f8f1c3@lightside-instruments.com> <b86abf02-137c-3806-798b-45d8961f66e7@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <b86abf02-137c-3806-798b-45d8961f66e7@nic.cz>
X-Clacks-Overhead: GNU Terry Pratchett
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/yjVSKnM8yCtCGwcpF36wWunF22k>
Subject: Re: [netmod] JSON to XML lossy conversion
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Jul 2020 12:42:36 -0000

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/>