From: netmod <[email protected]> on behalf of Jan Lindblad (jlindbla)
<[email protected]>
Sent: 29 August 2023 21:00
Carsten,
> Should list names be singular or plural?
The convention is to have the list name singular, and surrounding container
name plural. I would think someone just accidentally reversed the convention.
A quick grep across IETF RFC YANG modules for list names ending in s versus
ending with other letters gave 370 vs 1663 = ~20% (some modules may have been
scanned more than once, due to multiple versions etc).
For some transport encodings (e.g. XML), the surrounding container makes the
list contents a bit more manageable. A surrounding container is also a
convenient for use in filters and NACM rules.
<tp>
The issue I come across, saw it again today in nrp-yang, is
container interfaces
list interface
key interface
leaf interface
which I find clunky but do not have a good alternative for.
Tom Petch
Best Regards,
/jan
>
>
> Archived-At:
> <https://mailarchive.ietf.org/arch/msg/last-call/Nh_O8sREv7mBri2_lbIaijorjNE>
> As a convention, in IETF YANG modules, the node name of a list is in the
> singular form.
> Above the list there can be a container with a name in the
> plural form.
>
> This seems to be supported by the example in 4.26 in RFC 8407.
>
>
> Archived-At:
> <https://mailarchive.ietf.org/arch/msg/last-call/ERVfU5u9vwFe5VxOHcRN72EgBHY>
> The usual YANG convention is for a list to be plural and the leaf singular.
> You have the plural list but not the leaf. And who needs the container?
> This is mpls not a common module that might be augmented so what does the
> container give apart from complexity?
>
> (Note that this is contradicting the above.)
>
>
> RFC 9243 has plural for leaf-list interfaces {
> also RFC 9127 list interfaces {
>
>
> All examples in RFC 9254 (YANG-CBOR) have singular list names
>
>
> RFC8040:
> container interfaces {
> description "System interfaces.";
> list interface {
>
> RFC6243:
> container interfaces {
> description "Example interfaces group";
> list interface {
> description "Example interface entry”;
>
> The singular list name seems to be quite popular with a plural container name.
> Where there is no such container name, it gets a bit more mixed.
>
> Is there a document that I could consult?
>
> Grüße, Carsten
>
>
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod