[YANGTOOLS-762] yang-model-api: fix {Length,Range}Constraint Created: 22/Mar/17  Updated: 10/Apr/22  Resolved: 20/Nov/17

Status: Verified
Project: yangtools
Component/s: None
Affects Version/s: 1.2.0
Fix Version/s: 2.0.0

Type: Bug
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 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.



 Comments   
Comment by Robert Varga [ 28/Aug/17 ]

Preparatory patches, intended for Nitrogen backport:

https://git.opendaylight.org/gerrit/62277
https://git.opendaylight.org/gerrit/62278
https://git.opendaylight.org/gerrit/62279

Comment by Robert Varga [ 31/Oct/17 ]

RangeConstraint remodel: https://git.opendaylight.org/gerrit/62445

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