[YANGTOOLS-958] YANG parser does not complain about mandatory node in a default case Created: 27/Feb/19  Updated: 13/Dec/22

Status: Open
Project: yangtools
Component/s: parser
Affects Version/s: 2.0.10
Fix Version/s: None

Type: Bug Priority: Low
Reporter: Peter Verthez Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: pick-next, pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File example.yang    

 Description   

We are using version 2.0.11.

The YANG parser does not complain when you put a mandatory node in a default case in a choice (see the attached model). We saw this when we had a nested choice in a default case that was mandatory, but actually it is also the case if a default case contains directly a mandatory leaf.

According to the RFC this is not allowed. See section https://tools.ietf.org/html/rfc7950#section-7.9.3

pyang is giving an error on this:
example.yang:11: error: mandatory node in default case
example.yang:15: error: mandatory node in default case


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