[YANGTOOLS-551] yang-model-util: Cross-reference constraints and default value Created: 18/Nov/15  Updated: 23/Jun/20

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

Type: New Feature
Reporter: Robert Varga Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Duplicate
is duplicated by YANGTOOLS-591 Report error if default value for typ... Resolved
is duplicated by YANGTOOLS-963 YANG parser does not complain about i... Resolved
Relates
relates to NETCONF-703 Apidocs does not work in Aluminum Verified

 Description   

http://tools.ietf.org/html/rfc6020#section-7.3.4 specifies that whenever a type is derived so that its constraints are not satisfied by the default value, a new default value needs to be set.

This applies to DerivedTypes and ConcreteTypes, whose builder must check if this criterion is met. The check should be performed only when the default or constraints are changed. The problem should be reported via a new exception, DefaultViolatesConstraintsException, which is a subclass of IllegalArgumentException.

For performance reasons, which requires us to retain compiled regular expressions in PatternConstraint – define a new interface and an implementation, such that the compiled pattern can be exposed to other users.



 Comments   
Comment by Robert Varga [ 07/Mar/19 ]

Also covers the simpler case of YANGTOOLS-963.

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