[netmod] "leaf-list" value uniqueness within "sx:structure" instances

Jernej Tuljak <jernej.tuljak@mg-soft.si> Fri, 19 May 2023 12:55 UTC

Return-Path: <jernej.tuljak@mg-soft.si>
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 1296BC15108C for <netmod@ietfa.amsl.com>; Fri, 19 May 2023 05:55:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.097
X-Spam-Level:
X-Spam-Status: No, score=-7.097 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, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mg-soft.si
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q-zpKxX7g27Y for <netmod@ietfa.amsl.com>; Fri, 19 May 2023 05:55:40 -0700 (PDT)
Received: from galileo.mg-soft.si (gate.mg-soft.si [212.30.73.66]) by ietfa.amsl.com (Postfix) with ESMTP id 94862C15107E for <netmod@ietf.org>; Fri, 19 May 2023 05:55:38 -0700 (PDT)
Received: from [10.0.0.222] (tp-x61t.mg-soft.si [10.0.0.222]) by galileo.mg-soft.si (Postfix) with ESMTP id 64DB4C41D787 for <netmod@ietf.org>; Fri, 19 May 2023 14:55:36 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.11.0 galileo.mg-soft.si 64DB4C41D787
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mg-soft.si; s=default; t=1684500936; bh=SY1stGSX0VDgVtWiWbl9+ndJs0bI6WHEtO8blbE8UNQ=; h=Date:To:From:Subject:From; b=iiWYXbywtfcFQGzIG4cXYizQmnCn/Zg3zZC9CCQMInH2cl88N1Qelq8n/lqAnv16i R/0ULXsYTa/6MSc10EVMiq1Tn6l1Ib6E+IPd5QSjOu+qRnWbn+GjJq6M9eHfhYkuuv sRckwjlIaUdRCP2Jng4jKwQc2okNfumzD4xBeJq2FwLuwdY2bPkUeDX4JDEsc2FVIa VG02WcXGP/EWBc9e1hYQplS+0V8gT2lRZkpwsZ8rAGk7Eogj+H542awoQ6a2D8QAD3 iIHW44CwYS+PnZxDRxLtZuzZ2DP0rsIU4+YA0lZNxLiyPo4oSIQE8rB7Kmo5rDjpDR KSKbFsXRXWabg==
Message-ID: <7bd5900b-fcf3-5991-9a57-03cb06339372@mg-soft.si>
Date: Fri, 19 May 2023 14:55:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
Content-Language: en-US
To: NETMOD Working Group <netmod@ietf.org>
From: Jernej Tuljak <jernej.tuljak@mg-soft.si>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/BOvNccBIXTxCbXob-QMv2ziMzBM>
Subject: [netmod] "leaf-list" value uniqueness within "sx:structure" instances
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
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, 19 May 2023 12:55:45 -0000

Hi,

an "sx:structure" instance that contains non-unique values in a 
"leaf-list" is valid, since such an instance does not represent 
configuration data, per RFC 8791 (and RFC 7950).

module d {
   yang-version 1.1;
   namespace "d:uri";
   prefix "d";

   import ietf-yang-structure-ext {
     prefix sx;
   }

   sx:structure example {
     leaf-list entry {
       type uint8;
     }
   }
}

<example xmlns="d:uri">
   <entry>1</entry>
   <entry>1</entry>
   <entry>1</entry>
</example>

In other words, the above XML instance is valid per provided example 
YANG module. Uniqueness would need to be enforced via "must" statements.

Is this interpretation of the RFCs correct?

Jernej