-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priority of error messages during validation #2147
Comments
The original, internal bugreport which triggered this one is actually the behavior of |
I cannot help you in this case. The validation is performed first on parents and then on their children, nothing else makes sense. And because the |
Does netopeer2-server report all validation errors, or just the first one? |
Only the first one, currently. With several errors there is always risk of reporting some invalid/irrelevant ones (such as in this case) so I would prefer to keep it this way. |
In this case, though, the relevant error is the second one, while the first one is a bit misleading. |
Yes, but in most cases it is the other way around. There is no perfect solution and the current one is best from those available, I believe. |
It seems that some
must
violations are reported before themandatory
violations. For example, in this model:...and the following data:
...I get this message, and some SW which only reports the first violation (ahem ahem,
yang-cli
from netconf-cli) would only say thatCannot use frequency higher than 196.125 THz (Data location "/wtf:channel-plan/channel[name='x']".)
.Of course
yanglint
is a bit smarter:I was wondering if there's a way (apart from adding a
must "count(lower-frequency) = 1 and count(upper-frequency) = 1"
) so that the root cause, which is a missing node, is reported "more prominently". One could even argue that evaluating an XPath condition like this when there's no default value for that node makes little sense, but I don't know what the standard says about this.As a programmer, I guess this happens because the validation works from the root of the tree, and the
must
is actually present at the outer enclosing node, which gets checked before its children, right?The text was updated successfully, but these errors were encountered: