Fix relative xPath resolution for leafref types 06/89106/2
authormiroslav.kovac <miroslav.kovac@pantheon.tech>
Fri, 13 Mar 2020 13:49:23 +0000 (14:49 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 17 Apr 2020 20:01:43 +0000 (22:01 +0200)
commita7274ac8390326dd8f575df4ea672ad54e6311c7
treeddb3c94ea9caec79ec400577e49d75ed0d3eabe1
parentafa49e22a55f6ab4563154aa05ad0ed94e15619a
Fix relative xPath resolution for leafref types

If we have a leaf of type leafref with relative path that crosses
through case and choice schema nodes.

This stems from the historic disconnect about how the path should
be handled: it needs to be resolved in the context of walking the
data tree, not schema tree. That means that choice/case nodes are
not part of the path in the expression and therefore need to be
skipped over.

JIRA: YANGTOOLS-1100
Change-Id: I9908c91b0068f52f4b6719545c738d7c39e2a228
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-util-ut/src/test/java/org/opendaylight/yangtools/yang/model/util/ut/YT1100Test.java [new file with mode: 0644]
yang/yang-model-util-ut/src/test/resources/yt1100.yang [new file with mode: 0644]
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/SchemaContextUtil.java