[YANGTOOLS-963] YANG parser does not complain about invalid enum default after refining enum Created: 07/Mar/19  Updated: 07/Mar/19  Resolved: 07/Mar/19

Status: Resolved
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: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File example.yang    
Issue Links:
Duplicate
duplicates YANGTOOLS-551 yang-model-util: Cross-reference cons... Confirmed

 Description   

We are using version 2.0.11.

According to the YANG RFC https://tools.ietf.org/html/rfc7950#section-7.3.4 :

   If the type's default value is not valid according to the new
   restrictions specified in a derived type or leaf definition, the
   derived type or leaf definition MUST specify a new default value
   compatible with the restrictions.

The YANG parser does not complain about this, see the example yang model attached to this ticket, which is parsed without error.

For the same YANG model, pyang reports the following error:
example.yang:16: error: the value "one" does not match its base type - enum not defined for the default value


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