Details
-
Bug
-
Status: Verified
-
Resolution: Done
-
1.2.0
-
None
-
None
-
Operating System: All
Platform: All
-
8043
Description
model.api.type.LengthConstraint does not correctly model YANG's length keyword, as it provides only upper and lower bound, effectively forcing
{Binary,String}TypeDefinition types to report them as a List. This list is then interpreted as a set of ranges and the value needs to fit into at least one of them. Each of the ranges contains the same metadata, which makes error reporting a bit quirky.
The same problem exists with RangeConstraint.
Remodel these interfaces to include a RangeSet covering allowed ranges of values, so the type definitions only return a Optional<LengthConstraint>, against which validation is done.