Skip to content

XPath expressions in 'when' statement not using the correct context #112

@eelcocramer

Description

@eelcocramer

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:

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 server's 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions