Fix incorrect schema reference in root POST link 19/107419/15
authorŠimon Ukuš <simon.ukus@pantheon.tech>
Thu, 24 Aug 2023 09:36:09 +0000 (11:36 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Fri, 22 Sep 2023 07:49:17 +0000 (09:49 +0200)
commit49e965432e29092aa8aa3ffb64a5875632e3c255
tree61cbf7e1325692b79f0b04b1ce18d12416d36907
parent2a9984350c87c388b64115f66f563d5217122273
Fix incorrect schema reference in root POST link

We are creating a root POST link, when requesting swagger document
for single module. We were passing empty string as module name
when building the POST operation, which resulted in our schema ref
beginning with underscore (like this: "_toaster_module").
The schema is created, but without the leading underscore.

This patch fixes it by passing null value and adding logic
that performs the null checking to construct correct schema reference.

JIRA: NETCONF-1133
Change-Id: I9019dea1874133706f8825b0159e6c571d7b9558
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
restconf/restconf-openapi/src/main/java/org/opendaylight/restconf/openapi/impl/BaseYangOpenApiGenerator.java
restconf/restconf-openapi/src/main/java/org/opendaylight/restconf/openapi/model/builder/OperationBuilder.java
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiGeneratorRFC8040Test.java