Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> Wed, 10 October 2018 13:49 UTC

Return-Path: <jason.sterne@nokia.com>
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 10F3D130F05 for <netmod@ietfa.amsl.com>; Wed, 10 Oct 2018 06:49:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.356
X-Spam-Level:
X-Spam-Status: No, score=-2.356 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.456, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nokia.onmicrosoft.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 DKb-sPyR9IF4 for <netmod@ietfa.amsl.com>; Wed, 10 Oct 2018 06:49:16 -0700 (PDT)
Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40097.outbound.protection.outlook.com [40.107.4.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C2114130ED8 for <netmod@ietf.org>; Wed, 10 Oct 2018 06:49:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TTOmGeHwWhd61d58zNCTVXGHmtxOs1sQRDIw2fIyaqQ=; b=KSRL3wGOcY4kw52iVpZf4FsozwBvSsY9SB50KyHYcdCwFN5FxWIILn37PIgIS1lLyqExS0nyE+gk+un9Jv8hr/NZzkTmwN8m7ZHR0zU+eX/ea5tVc/rnPweiIa7WHxihB00PT4vPgkCJ4ATm/ZkezPOSINewx6iNGgjAV/Gz8TQ=
Received: from VI1PR07MB3981.eurprd07.prod.outlook.com (52.134.28.141) by VI1PR07MB1038.eurprd07.prod.outlook.com (10.161.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.19; Wed, 10 Oct 2018 13:49:08 +0000
Received: from VI1PR07MB3981.eurprd07.prod.outlook.com ([fe80::a8a1:3ccb:986d:dad3]) by VI1PR07MB3981.eurprd07.prod.outlook.com ([fe80::a8a1:3ccb:986d:dad3%5]) with mapi id 15.20.1228.020; Wed, 10 Oct 2018 13:49:08 +0000
From: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
To: Michael Rehder <Michael.Rehder@Amdocs.com>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: WHEN statement within mandatory objects doesn't ensure presence of the mandatory object
Thread-Index: AdRf+I5wQXpIeuYeT8uFcZ4kUETNSAApogGQ
Date: Wed, 10 Oct 2018 13:49:07 +0000
Message-ID: <VI1PR07MB39811849476E3C09CDE8516C9BE00@VI1PR07MB3981.eurprd07.prod.outlook.com>
References: <AM0PR06MB4083426FA0F1D3F6515F2ECFE7E70@AM0PR06MB4083.eurprd06.prod.outlook.com>
In-Reply-To: <AM0PR06MB4083426FA0F1D3F6515F2ECFE7E70@AM0PR06MB4083.eurprd06.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [135.245.20.4]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; VI1PR07MB1038; 6:+ql9oZZRiG/7DWbny+AmUPw3npqlAOJpiqEjRxqrdEgylqx1n4jeg1ZhzebhWXelQIS7t+T8w0ScSoe7vWwWNAgsyGK6e5SbpDWIAdiviOaTP8YyC5jiPFO1k/U9CD4f1yGj9M7hXfskZqQAswXt2ZT5iGXALGS3Sdt7LumH5jhKkEJDosrK+kvEgfUJNkU0lDWfmCIzgqELh70YU84H4VrJA42MZ5owiPOWC3OQs7WrEh0GCO/gUjm1OvsLnmAE+B3V8vWnhlpeKXr2NXEAczk6+g7maj7qv3ehHzRRrxAgHw/cPtdARTlS0meRe7ZHyslGckYO6KKlr6wZGLEaJgARJWT+igfpOzHtbkwcDUttuQb/FIzUXYIeC9cOVtT0jt0LJyl9Tjlctzm8BZrC0fzLlYT/Bdxm3X4YHnds6MwCHD6XeHZpfio3rWLytEX9zCeX1MT0PAeAYuzSNR33MQ==; 5:eDBxfiw9LEt93YjZcs1EY1HZn3SpJ5oQ0++JpAdvQKqUJ9ddnuqwTAn+HeSHsdZOOeMNu1R6W75j5ER+6oThlFK/AYl1Ai+IJhagyd7PHrim9EpBkSmN4gM3rM1OIB5nx29NHve3mIUgkg4ZZNk0QTLRpFPgCyc7pokTerYw8Z0=; 7:jWrvlQs8YdD4kEb9x2y7vCONERkCS+THDPCkob00Gq6VjHapZC3FxdhLE65TTBeKqhmuKvXpFyAIRabI/dQ4HljphNVl5NZurqSTLqTO1aRfjLdz1RnJET1o6o21RbSQKqX2QzA4bWWKIRug865GDL+1TaaFXX2repaXM8T2/M+5lVUuL135SPeZoVwyBjv3Pf/+vomUVMr4fINKmQdJy1YYXnhA80cwSNvGge1RyiyMX+eyDMQ/RBdOe8D9swH4
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 5922e087-4579-458c-e700-08d62eb72691
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:VI1PR07MB1038;
x-ms-traffictypediagnostic: VI1PR07MB1038:
x-microsoft-antispam-prvs: <VI1PR07MB1038131EB0F03D7D8D8504A69BE00@VI1PR07MB1038.eurprd07.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(21748063052155)(28532068793085)(190501279198761)(227612066756510);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(11241501184)(806099)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991055); SRVR:VI1PR07MB1038; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB1038;
x-forefront-prvs: 08213D42D3
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(346002)(39860400002)(366004)(136003)(51444003)(189003)(199004)(6246003)(86362001)(53936002)(476003)(6306002)(54896002)(9686003)(55016002)(6436002)(229853002)(11346002)(33656002)(25786009)(99286004)(6116002)(3846002)(790700001)(102836004)(110136005)(6346003)(486006)(446003)(7696005)(76176011)(66066001)(8936002)(2900100001)(74316002)(71190400001)(71200400001)(5660300001)(256004)(478600001)(6506007)(53546011)(81156014)(9326002)(81166006)(26005)(2906002)(8676002)(186003)(14454004)(68736007)(106356001)(7736002)(105586002)(97736004)(2501003)(316002)(5250100002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB1038; H:VI1PR07MB3981.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=jason.sterne@nokia.com;
x-microsoft-antispam-message-info: cisucTIk4HD5h2rVdEI5Iq8uXe6fJ2lY0RoqWoNrE58jehJ+oQsnx1KxiCzSOqDafGwhiqAs6evHrAYAUKctIbbwCBa1YwC2DrGs/x272T5sQAHLeqGaO3r6biSkFqLBcDGLlTUOn7WHEQ9IDGfsgBpGrac3DJ5LB8WY8UgZ5plbBQJ4onUoeFYDPcCpTx94/4MT/cj/jfn0ttIcTTlcpX4CtKAyLN/+CTWS5yIJdJFGRz+tnzL6gJ2wgk4Nu87a2XOgjm9JyszTcHLnNgrjQWOUWJT7QYS8+JQcZetqdUum9MRdxmIKwvN3qcEPDkEXF+ZSoUuB63YVbvLh0agc84P1+2Tp7/c318p4LO90HIrYTGYxlVO9IJysNDP/BjqR0XY4Wx8jBE2BX+as63KvgQ==
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_VI1PR07MB39811849476E3C09CDE8516C9BE00VI1PR07MB3981eurp_"
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5922e087-4579-458c-e700-08d62eb72691
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2018 13:49:07.9822 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB1038
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/_ZeDtzAcfzIRfyAn8MBcIaIoEF8>
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object
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: Wed, 10 Oct 2018 13:49:19 -0000

Hi Mike,
Please see below.
Jason

From: netmod <netmod-bounces@ietf.org> On Behalf Of Michael Rehder
Sent: Tuesday, October 9, 2018 1:51 PM
To: netmod@ietf.org
Subject: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

I have a question about “when” and mandatory objects.

It seems to me that the implemented semantics of “when” are really “optional when”, in that the enclosing object can be absent even though it is mandatory and the “when” clause holds true.
The RFC could be clearer about this.

Example

   leaf color {
     enumeration  {
        enum “blue”;
        enum “black”;
     }
     mandatory true;
   }
   container foo {
      when ../color = ‘blue’;
      etc.
   }

“foo” is optional due to the presence of the “when” statement even though the object is mandatory (same is true for mandatory leaf, min-elements=1 list etc.).
[>>JTS: ]  What do you mean by "the object is mandatory" ?  I see that leaf color is mandatory (so it must have a value of either black or blue).  But the container foo is not mandatory.

This is considered valid XML for the above
    <color>blue</color>

In my view this makes conditionally variant schemas “loose” in their enforcement (some scenarios can use choice but it doesn’t cover everything).

I think that mandatory should be respected for the enclosing objects of a “when” statement.
That is, a mandatory object must be present when its “when” clause holds true and a Schematron statement should enforce that.
[>>JTS: ] We can't change that definition now. I don't know all the details of the rationale but "when" is defined such that its parent data definition statement is only valid when the condition in the "when" is true. But that doesn't mean that parent node is mandatory. In other words -> a "when" can only remove a node (from the schema), it can't enforce that a node exists (in instance data).

What is the rationale behind the current YANG rules behavior, that the “when” Schematron mapping doesn’t check for presence of the enclosing mandatory object?

thanks
Mike Rehder


“Amdocs’ email platform is based on a third-party, worldwide, cloud-based system. Any emails sent to Amdocs will be processed and stored using such system and are accessible by third party providers of such system on a limited basis. Your sending of emails to Amdocs evidences your consent to the use of such system and such processing, storing and access”.