Do not use SchemaNode.getPath() in RestDocgenUtil 50/98250/18
authorManoj Chokka <cmanoj8@gmail.com>
Mon, 1 Nov 2021 05:20:10 +0000 (05:20 +0000)
committerTomas Cere <tomas.cere@pantheon.tech>
Thu, 17 Feb 2022 10:55:34 +0000 (10:55 +0000)
commit6e3a54d28b11028ba40605205a7be89c375eaca5
tree024f78468241038ea5fdaf882b68e48422b2e3c8
parentb962a56278c0d0ad060cfbd02387821a878ee98f
Do not use SchemaNode.getPath() in RestDocgenUtil

Instead of investigating full schema path we can just use
the parent node QName to determine if a child is in the same module
as its parent.

To compare name-space and revision we work with QNames -
we have adapted method resolvePathArgumentsName(..) parameters
to require QNames.

We can go further and mark all parameters as NonNull because
the use-case when parent is null has no sense - we are at direct
child of module - so full path should be used.

Align parameter usage across the methods -
first is node's QName the second is node's parent's QName.

In addition, mark not-used resolveNodesName(SchemaNode, Module) method
as deprecated for removal.

To simplify situation in callers we can resolve resource path before
addPaths or addOperations methods are called. This way we do not need
to increase the number of parameters.

JIRA: NETCONF-819
Change-Id: Ib7a7614a70c9573521c47716c62ec74f887e6132
Signed-off-by: Manoj Chokka <cmanoj8@gmail.com>
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/BaseYangSwaggerGenerator.java
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/util/RestDocgenUtil.java