[yang-doctors] QQ on mandatory statement
Mahesh Jethanandani <mjethanandani@gmail.com> Tue, 03 March 2026 18:11 UTC
Return-Path: <mjethanandani@gmail.com>
X-Original-To: yang-doctors@mail2.ietf.org
Delivered-To: yang-doctors@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 70DB3C39A95E for <yang-doctors@mail2.ietf.org>; Tue, 3 Mar 2026 10:11:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2ZVxZWlu7jV8 for <yang-doctors@mail2.ietf.org>; Tue, 3 Mar 2026 10:11:56 -0800 (PST)
Received: from mail-dl1-x1229.google.com (mail-dl1-x1229.google.com [IPv6:2607:f8b0:4864:20::1229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 7C5D8C39A94D for <yang-doctors@ietf.org>; Tue, 3 Mar 2026 10:11:56 -0800 (PST)
Received: by mail-dl1-x1229.google.com with SMTP id a92af1059eb24-1279eced0b9so3430058c88.0 for <yang-doctors@ietf.org>; Tue, 03 Mar 2026 10:11:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772561515; x=1773166315; darn=ietf.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=O3k0nvo9eyS1l7+JZaOWZjqy35HJ9xSQjgHJcoQ88Yo=; b=cFrKfEzCbpUbou8Ds0uTR+puJSJeom3T9ylbj5ZMxvYBo1BpOGycJf0VgLyZce5bxp DGUkwvETVL3ACRS/GJ5HqBY5ER/J50L40PQM1Maj8od2euPm4ID3oNyfNy3A+cbA8fiK 2cGdBeV5uJ5BAbdYGGabQAjmABIJM8613b4gz5wh0EvAHDmYPHvB/DDOI908q94licJV ODK20Gr8yLyPgSjkr6wB5lp2rpi8/UBMygnUML5XWsWejcDUVoA8yqi7IVRFKwdsb42t ybdtJml8HsZCeGswCiSpqaJMitb3lDQTRFjYDt5NGz0Xu1N2XsqVWxpiQ2SRV9EJG6eK paVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772561515; x=1773166315; h=to:date:message-id:subject:mime-version:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O3k0nvo9eyS1l7+JZaOWZjqy35HJ9xSQjgHJcoQ88Yo=; b=DE0zRXX7Ptgq6aLlM1ZFX8ghqpAtp5mGd0PcvK4V7lpvwYijXCkWp+XDjmMOPp6cDt mp8YUWVIBWaS4XI8BEUS4Yg+WZ0nyTLxUvRnb3CYgD7KIImZY+uKH3AgXSKsvttrVQDW Uxv/sOuggQPzfGRbiKbhI0oGOTV0EoBhmtIu8QTIUSkMND73JzE2VBffvMJ1ma2/bz4x Ez8ye5UyOJn8+6EAdz6mha7fzueHnncFBZJ+thmoP+fPGkvkQ/joUWn2MavGHfaSEORm m1wwppeG4937xzQ4Vvo+r3w1X7Bol/5WwJaCYMdF2fCkTaaEfGoKpkGw23BEfSl4GHKp /jOg==
X-Gm-Message-State: AOJu0YyzqBPssgzMSSNyp96GN+rBfIyUJ0SezWrXVkBrDcGBKS9q17CX eYmTBys+myLsUkPsf0tZ9d77FwrHqqx7pozN047zFU3dLj7h6YXsF5NNueSUWA==
X-Gm-Gg: ATEYQzyizFEyCOju2Hh+0xu5bzYW3CvVJqoE5ayI8wv3sXsRmdO1gxOWu/R2T3jZXFh GDIEINfVPDZDi8YhEPlLFYdqy2i3dop4YSsEVQkMgupSbcSLjedsL47kfqwOqW42Hgi/LM5uHoy Ckkv8XP7EH/zup/FbcQzCMngrOKzrcW7O59iyy+JJgTEa+QeGs1cMbz0m7fsR0Cs0uGxPTlTtNr xuEhWIHeI36t1qPl9xpDN7I9D4meSLlokTLl9IkZyjXKjKuMvMaLKtwvC4gXULR4BImPKOu5wCi lnZ6JmmNbIzhYOGc3QDJSvRKTT8D7rnZEcqwQXidf68fzceYhusmjfcfzuqzSgn9FDYYW6dx7eG /bFN1eoVVgJ4MhbzADyQ2NH97z4CDT5m/WMs3CECcNotUAR4uGdp0S+pJZwmWsWVXxcj/VmoKTJ kaGgKaeJ1JreN1VlQ/ta+SQE6iuVlZN0Rk/7i0CVUr9k/14Q0yDjWoDOKI8u7daDDfOaahM3Rn4 M0iIq4=
X-Received: by 2002:a05:7022:60b:b0:11a:fb3c:568b with SMTP id a92af1059eb24-1278fb8f9ccmr5852914c88.17.1772561514934; Tue, 03 Mar 2026 10:11:54 -0800 (PST)
Received: from smtpclient.apple (c-67-180-189-3.hsd1.ca.comcast.net. [67.180.189.3]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12789a43885sm21220031c88.12.2026.03.03.10.11.54 for <yang-doctors@ietf.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2026 10:11:54 -0800 (PST)
From: Mahesh Jethanandani <mjethanandani@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_F3CE820A-D774-4AD3-BEEF-AAC25A9AA9C5"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.21\))
Message-Id: <E79B5167-1CE3-4806-BADA-DFF966A19C35@gmail.com>
Date: Tue, 03 Mar 2026 10:11:40 -0800
To: YANG Doctors <yang-doctors@ietf.org>
X-Mailer: Apple Mail (2.3731.700.6.1.21)
Message-ID-Hash: NXUG3HRF2V6A7LGL75RGCIJF55IDPFCI
X-Message-ID-Hash: NXUG3HRF2V6A7LGL75RGCIJF55IDPFCI
X-MailFrom: mjethanandani@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-yang-doctors.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [yang-doctors] QQ on mandatory statement
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/UEkBjAVgcK4L1gmLQ6YnYE3f1Ok>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Owner: <mailto:yang-doctors-owner@ietf.org>
List-Post: <mailto:yang-doctors@ietf.org>
List-Subscribe: <mailto:yang-doctors-join@ietf.org>
List-Unsubscribe: <mailto:yang-doctors-leave@ietf.org>
I have a quick question about the use of a mandatory statement. draft-ietf-ccamp-optical-impairment-topology-yang-23 <https://datatracker.ietf.org/doc/html/draft-ietf-ccamp-optical-impairment-topology-yang-23> includes this mandatory choice statement, where the model ensures that one of the cases is selected in the config. However, the model defines two case statements, each with a leaf that also has a mandatory statement. I realize that the ABNF grammar does not explicitly prohibit it, but ...
Having a mandatory statement under choice would be sufficient. When would one need to define a mandatory statement under each of the cases, when both the case statements have a single leaf? Isn’t the mandatory choice satisfied since one of the leaf types has to be defined in the config tree?
container power-param {
description
"Amplifier elements typically equalize the optical
power across the amplified channels using one of the
available equalization strategies - either targeting
a specific output power, or a specific power spectral
density (PSD), after the out-voa.";
choice power-param {
mandatory true;
description
"Select the mode: channel power or power spectral
density (PSD).";
case channel-power {
leaf nominal-carrier-power {
type l0-types:power-dbm-or-unknown;
mandatory true;
description
"Reference channel power.";
}
}
case power-spectral-density {
leaf nominal-psd {
type l0-types:psd-or-unknown;
mandatory true;
description
"Reference power spectral density (PSD).";
}
}
}
} // container power-param
Thanks in advance.
Mahesh Jethanandani
mjethanandani@gmail.com
- [yang-doctors] QQ on mandatory statement Mahesh Jethanandani
- [yang-doctors] Re: QQ on mandatory statement Ladislav Lhotka