Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Duplicate
-
2.0.10
-
None
-
None
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
Attachments
Issue Links
- duplicates
-
YANGTOOLS-551 yang-model-util: Cross-reference constraints and default value
- Confirmed