[netconf] Guidelines for YANG anyxml/anydata statements in RFC8040 (Restconf)

Henning Rogge <hrogge@gmail.com> Wed, 29 April 2020 13:18 UTC

Return-Path: <hrogge@gmail.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id ED2B03A0F00 for <netconf@ietfa.amsl.com>; Wed, 29 Apr 2020 06:18:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 dJi5wqitwpk9 for <netconf@ietfa.amsl.com>; Wed, 29 Apr 2020 06:18:20 -0700 (PDT)
Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 27B0D3A118B for <netconf@ietf.org>; Wed, 29 Apr 2020 06:17:18 -0700 (PDT)
Received: by mail-lj1-x242.google.com with SMTP id f11so2590517ljp.1 for <netconf@ietf.org>; Wed, 29 Apr 2020 06:17:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=5IfB23ocs3SLDq22Zb98VO4f5pI6Nk63ZaS5JOFQS6g=; b=fAM4aQ4mXNPhpDR86v0AlK0njgPBSuG9rCh8anwRKm7gr/MN2hTIWPu/rlW/rbbwyU PonCEfBn38v59CBSaMNpM2nBMBRqiZ+M7GaTSDlLfT6fSOqtmnwH329T2AYA9iQ9dwjQ EVRAENhGTIQ4NfllcrMztqSxXLBcEzrTlx4NFY+VtjmRIklAwT+TjRFW/uEyzw7v0EKl WL4NUSmp02euFHjYDCRCbKb/MtmniSVvog+3q32zaKTlQAybGuKP5nvkicFIai915pnU ETFGMJ0X61doUQLzpIFjasrYrQll33GApekYtCfCW4y4V9n9jhIBOQ2eBIBH/PrspYII C18A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5IfB23ocs3SLDq22Zb98VO4f5pI6Nk63ZaS5JOFQS6g=; b=OPs1beSHzcmDsbhP/bo/0y56vhQb1MQ9oKCUWlhOERNYtXyrA9ZymgYZ2dQk3R1L7n AvQs6PT0n8lEDJUPHnnHfKM/Tv412dI2c/kTnWtZMoQXOgpcbdYm1kRgevwd59DL4BP5 PYA58RIF4OmiC1RCmEWCJrjNw5fY7FWhwPLnCdIPuXpv4nchzbb2hqbeEAPiFTwF8UgN dlnm7fWUqd9xciUzCMGiH2R86ONvnEAMkr9kSySVa687n/9KHvlrU01COJkJvSMkF5Yf TxmhY5oItVT9e3TqsjN0O17DdFlNkY8US8C+FHLOyxlujOrRS+t+qjeHmv+lRI81tgQy Yj6A==
X-Gm-Message-State: AGi0Puai2XaAT7ndc3Zykm096Y2lNsroKi8Hqj9i+n8tfadvzL0wvJYA XtJRZAx/9biZyHABJT9BzdXlQq8o/QDevw3SK6IQhG/g
X-Google-Smtp-Source: APiQypIS8q4KEI5JOF1TvBFmsDg7Y2aYdtcTkMQ/y9wZumyHZCRkvPMtxutWP90tDHCep94iL86H8Yboq3Em3nbtWTU=
X-Received: by 2002:a2e:8693:: with SMTP id l19mr20692347lji.63.1588166235802; Wed, 29 Apr 2020 06:17:15 -0700 (PDT)
MIME-Version: 1.0
From: Henning Rogge <hrogge@gmail.com>
Date: Wed, 29 Apr 2020 15:16:49 +0200
Message-ID: <CAGnRvuqPwW4=6sZbuem94gaW5dnZ8mXgkrALbYHb05JTh_RAaA@mail.gmail.com>
To: netconf@ietf.org
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/1Kd5yfM0zAlaDaOasSJDX1wZUJY>
Subject: [netconf] Guidelines for YANG anyxml/anydata statements in RFC8040 (Restconf)
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 29 Apr 2020 13:18:22 -0000

Hi,

I have some trouble with the anyxml/anydata YANG statements in
Restconf... to be more precise in a Restconf-server that accepts both
XML and JSON transport encoding.

The anydata issue is that there are some "data resources" that have
the same XML transport encoding but different JSON encoding. Which
means I cannot "guess" the YANG schema of incoming XML data for an
anyxml statement.

If I read RFC 7950 and 7951 correctly, then a (as an example)
leaf-list with a single entry has the same encoding in XML as a leaf
of the same name... but not in JSON. Same is true for a list with one
element and a container.

The problem with anyxml is the same and worse... RFC 7951 section 5.6
demands transporting the data encoded in JSON (and not in a string
that contains the XML data), but does not define how to encode the XML
data into JSON and the other way around.

Are there any guidelines/best-practices for this problem?

Thanks

Henning Rogge