Replace #getPath in processInstanceIdentifierType 99/99699/3
authorIvan Hrasko <ivan.hrasko@pantheon.tech>
Fri, 11 Feb 2022 19:57:19 +0000 (20:57 +0100)
committerTomas Cere <tomas.cere@pantheon.tech>
Thu, 17 Feb 2022 10:55:34 +0000 (10:55 +0000)
commit445e898b86ffe443776037e0fc769ddce3d19f58
tree53ee76cc71ca80483be6b9b857f4e6ee68a2d8de
parent6e3a54d28b11028ba40605205a7be89c375eaca5
Replace #getPath in processInstanceIdentifierType

DefinitionGenerator#processInstanceIdentifierType method was used to
create an example of the instance-identifier leaf node's value.
For this purpose SchemaPath#getPath method was used to search for 'root'
container.

In fact, this approach leads to incorrect results because it can for example
find an RPC definition as 'root' container. RPC definition cannot be used as
instance-identifier value because its not a data node.

We have reworked this method to use as an example the first container child
of the node's model.

This way we can also get-rid of deprecated SchemaPath#getPath method.

Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Change-Id: I2a4f1dc2e76ae9117bc826e45b0d9c0379cb5213
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/DefinitionGenerator.java