[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
|
| Comments |
| Comment by Robert Varga [ 21/Jul/23 ] |
|
This absolutely intentional. The quoted restriction is a leak from NETCONF protocol (i.e. addressability). See 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(). |