You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deref of an empty leafref reports further validation failures #2592
Here's how it fails. The first error message is expected, the second is, in my opinion, a superfluous one:
$ yanglint -t config deref-arith.yang data.json
libyang err : Invalid leafref value "missing" - no target instance "/band/name" with the same value. (/deref-arith:channel[band='missing']/band)
libyang err : Band is narrower than 50 (/deref-arith:channel[band='missing'])
YANGLINT[E]: Failed to parse input data file "data.json".
We bumped into this in a unit test of our internal project.
I wonder if it's possible (and standard-compliant) to return a better error message here. Please note that my target audience is not the author of the YANG model or someone writing the YANG data in JSON/XML/..., but someone who works with a CLI, who just made a typo in a leafref name, and who is confused by an error message complaining about a "too narrow channel".
The second message is the result of multi-error validation. The first error reports invalid band value and the second invalid channelmust condition, for libyang the 2 are not connected. So, I am not sure what to improve.
Activity
michalvasko commentedon Oct 19, 2026
The second message is the result of multi-error validation. The first error reports invalid
bandvalue and the second invalidchannelmustcondition, for libyang the 2 are not connected. So, I am not sure what to improve.