Fix mandatory enforcer failure on augmented nodes 34/96234/12
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 18 May 2021 08:28:13 +0000 (10:28 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Jun 2021 06:17:59 +0000 (08:17 +0200)
commit7862271a33b14d21ebf1e72aacd05d3e4687c6b1
tree2be8eb23c0b9534b3b125e533748d308abfb6f8f
parentd3fcf5ed18efa48efff27b77b3e2a06cbb004626
Fix mandatory enforcer failure on augmented nodes

Changes the way mandatory nodes are extracted from the schema.
Previously all mandatory nodes were approached as direct children of
the parent node. Even if they came from an augmentation which caused
"missing mandatory descendant" exceptions.
This patch preserves both options of building data nodes containing
augmented mandatory nodes.
- setting the mandatory node as a direct child of the parent node
- setting the mandatory node as an AugmentationNode to the parent node

However the former option seems to be incorrect and might be removed
in the future major release.

JIRA: YANGTOOLS-1276
Change-Id: Ifcc2e0d141e18f74173f15e293b16cbd297a5af6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
data/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/MandatoryDescendant.java [new file with mode: 0644]
data/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/MandatoryLeafEnforcer.java
data/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/YT1276Test.java [new file with mode: 0644]
data/yang-data-impl/src/test/resources/yt1276.yang [new file with mode: 0644]