Fix relative xPath resolution for leafref types 05/89105/1
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 19:08:18 +0000 (21:08 +0200)
commit43a5c0f10e6080613eaafec266003825b80de018
tree26a4061f6576a010c97787f0fde2b4286f62dd77
parent26184491fe9cf70ea8920aff47c8ed2fdf78562c
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