[NETCONF-876] Invalid error message for joint ranges Created: 27/Apr/22  Updated: 26/May/22

Status: Open
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Valentin Mayamsin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Version: Aluminium SR1



 Description   

YANG model has a leaf defined as:

leaf myleaf {
    type uint8 {
        range "0..1 | 128..255";
         }
}

When RPC is being called with invalid myleaf value between 2 and 127 RESTCONF replies with correct error message:

{"errors":\{"error":[{"error-type":"protocol","error-tag":"malformed-message","error-info":"Value \'100\'  is not in required ranges [[0..1], [128..255]]","error-message":"Error parsing input: Value \'100\'  is not in required ranges [[0..1], [128..255]]"}]}}

However if RPC is being called with invalid myleaf value above 255, it replies with invalid error message:

{"errors":\{"error":[{"error-type":"protocol","error-tag":"malformed-message","error-info":"Invalid range: 300, expected: [[0..255]].","error-message":"Error parsing input: Invalid range: 300, expected: [[0..255]]."}]}}


 Comments   
Comment by Robert Varga [ 26/May/22 ]

The two failures are slightly different, coming from two processing stages:

  • the second error comes from parsing the input as an 'uint8', which actually is the first stage which implies an upper bound of 0..255.
  • the first error comes from enforcing type restrictions on the parser value, which is actually the second stage
Generated at Wed Feb 07 20:16:07 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.