[netmod] mandatory choice with non-presence container case

Michal Vaško <mvasko@cesnet.cz> Mon, 24 June 2019 16:39 UTC

Return-Path: <mvasko@cesnet.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost []) by ietfa.amsl.com (Postfix) with ESMTP id 6F1141201A0 for <netmod@ietfa.amsl.com>; Mon, 24 Jun 2019 09:39:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Status: No, score=-1.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cesnet.cz
Received: from mail.ietf.org ([]) by localhost (ietfa.amsl.com []) (amavisd-new, port 10024) with ESMTP id dvNrfng1pESx for <netmod@ietfa.amsl.com>; Mon, 24 Jun 2019 09:39:23 -0700 (PDT)
Received: from kalendar.cesnet.cz (kalendar.cesnet.cz []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 38D89120176 for <netmod@ietf.org>; Mon, 24 Jun 2019 09:39:22 -0700 (PDT)
Received: by kalendar.cesnet.cz (Postfix, from userid 999) id 8160E601AE; Mon, 24 Jun 2019 18:39:18 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=kalendar; t=1561394358; bh=Xqt73bVzrJgEQLn5vMKTrHG2z6mVP9zwykY6QDrKJ3E=; h=To:Date:Subject:From; b=14ewadb6KNWW2C0LxNspvmcwtDI1LrSxJp7AMsOT9EtV2GDi2wOX3B+Pot8QyMlX6 qEEgC5XIy2wa5Dc6ZDHT+VJbzBaaaSZcL3J6KE0MCbtY1YtQlRKV5lsNe2B9sww9V6 uH8nz9PgFzqOewv2Pw35ISOQFc7SHCcsNoCNcMvs=
Content-Type: text/plain; charset="utf-8"
To: netmod <netmod@ietf.org>
User-Agent: SOGoMail 2.3.23
MIME-Version: 1.0
Date: Mon, 24 Jun 2019 18:39:18 +0200
Message-ID: <7797-5d10fc80-6f-35dfff00@18550372>
From: Michal Vaško <mvasko@cesnet.cz>
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/xGuxYukXwWBlp7PndjzyWblHo3I>
Subject: [netmod] mandatory choice with non-presence container case
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: Mon, 24 Jun 2019 16:39:25 -0000

I have encountered a situation that I think is not covered by RFC 7950. My specific use-case was as follows.


container TOP {
  leaf L {
    type empty;
  choice A {
    mandatory true;
    container C;



Parsing was successful, but printing these data back to XML produced:


and parsing this correctly failed with missing mandatory choice. According to section 7.5.7 [1], I think the C container could be omitted but the whole situation does not seem correct. Thank you for any input.


[1] https://tools.ietf.org/html/rfc7950#section-7.5.7