-
Notifications
You must be signed in to change notification settings - Fork 15
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
XPath expressions in 'when' statement not using the correct context #112
Comments
There's an xpath package and even a grammar file in yacc syntax that may or
may not to the issue.
This is likely on the tougher side to look at, I can help if you cannot
find it
…On Sat, Jul 13, 2024, 5:20 AM Eelco ***@***.***> wrote:
I wanted to make this into a PR but cannot really find where this should
be fixed. Any pointers that help me put this into a PR are appreciated!
I'm using the when
<https://datatracker.ietf.org/doc/html/rfc7950#section-7.21.5> statement
in an action output:
output {
leaf status {;
type boolean;
mandatory true;
}
leaf message {
when "../status = 'false'";
type string;
}
}
According to yang linters the XPath ../status is correct but when I use
this with freeconf I get an error in the restconf servers response: '..'
not found in xpath
When I change the xpath query in the when statement to when "status =
'false'" the output of a restconf request is rendered correctly. However
now the yang linters complain:
warning: node "component::status" is not found in "component::message"
—
Reply to this email directly, view it on GitHub
<#112>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7UOUWABPHOKGCGKF3TZMDWL3AVCNFSM6AAAAABK2DYA3KVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYDMOBRGU3DMNQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
An update. I added a test case to reproduce this issue in my cloned repository. Test case can be found here. The error is generated in the |
I tried running the test with a debugger to see if I could understand how it works but I'm lost at the |
If the error is in resolvePath then bug is not in yacc.
Does the xpath work in config tree (i.e. not in an output directive)?
…On Tue, Jul 16, 2024 at 3:18 AM Eelco ***@***.***> wrote:
I tried running the test with a debugger to see if I could understand how
it works but I'm lost at the yacc stuff.
—
Reply to this email directly, view it on GitHub
<#112 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7RKW5ZXYJ3HCH34Z4LZMTCLRAVCNFSM6AAAAABK2DYA3KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZQGE4TGNJZGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is "../status" incorrect? parent of output would not have the "status" field. |
But |
I wanted to make this into a PR but cannot really find where this should be fixed. Any pointers that help me put this into a PR are appreciated!
I'm using the when statement in an action output:
According to
yang
linters the XPath../status
is correct but when I use this with freeconf I get an error in therestconf
server's response:'..' not found in xpath
When I change the xpath query in the
when
statement towhen "status = 'false'"
the output of a restconf request is rendered correctly. However now the yang linters complain:The text was updated successfully, but these errors were encountered: