Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-762

yang-model-api: fix {Length,Range}Constraint

    XMLWordPrintable

Details

    • Bug
    • Status: Verified
    • Resolution: Done
    • 1.2.0
    • 2.0.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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: