[YANGTOOLS-1526] Unkeyed config list is not rejected Created: 21/Jul/23  Updated: 21/Jul/23  Resolved: 21/Jul/23

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Ivan Hrasko Assignee: Robert Varga
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

According to https://datatracker.ietf.org/doc/html/rfc7950#section-7.8.2 a configuration list must have a key:

The "key" statement, which MUST be present if the list represents
configuration and MAY be present otherwise, takes as an argument a
string that specifies a space-separated list of one or more leaf
identifiers of this list.

But we can create model which contains unkeyed config list as shown in NETCONF-1082.

 



 Comments   
Comment by Robert Varga [ 21/Jul/23 ]

This absolutely intentional. The quoted restriction is a leak from NETCONF protocol (i.e. addressability). See YANGTOOLS-1423 et al.

If you need the ability to optionally reject such models, this needs to change YangParserConfiguration.warnForUnkeyedLists() to allow specifying policy. Also the implementation of that flag needs to be reworked to address YANGTOOLS-1186 and work during inference rather than during buildEffective().

Generated at Wed Feb 07 20:56:24 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.