Details
-
Improvement
-
Status: Resolved
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
-
Operating System: All
Platform: All
Description
Yangtools should be augmented to report an error in the following block:
typedef listen-ipv4-address
{ type iit:ipv4-address; //default "0.0.0.0"; default "xxx"; }The value of "xxx" provided for "default" does not match the constraints of the base type (ipv4-address), which is defined by a pattern.
In the Xored YangIDE Eclipse plugin, which uses Yangtools, this does not report an error.
In constrast, the Pyang Python compiler reports the following:
error: the value "xxx" does not match its base type at ietf-inet-types.yang:179 - pattern mismatch for the default value for pattern defined at ietf-inet-types.yang:184
This is as used in the Yang Design Studio Eclipse plugin, which utilizes Pyang.
When I reported this in the yangtools-dev mailing list, Robert Varga indicated "it would require
the parser to have knowledge of data type binding – something which it currently does not have."
I'm interested in any issues that show a disparity between what pyang acknowledges as valid Yang code, compared to Yangtools. This isn't to be "competitive", it's simply to provide consistency with other tools in the domain.
Attachments
Issue Links
- duplicates
-
YANGTOOLS-551 yang-model-util: Cross-reference constraints and default value
- Confirmed