Skip POST for nodes without container/list child 75/108275/8
authorSamuel Schneider <samuel.schneider@pantheon.tech>
Fri, 6 Oct 2023 15:23:43 +0000 (17:23 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Mon, 23 Oct 2023 13:23:38 +0000 (13:23 +0000)
commitc62bceb1b3054e440181864569896bbc8c2736f4
tree3bce5b56983081f5a0d68d00aabce54dc4c8cd9f
parent1961de039cc598e0634dfecc0788218396ba6efc
Skip POST for nodes without container/list child

Remove generation of post operations for nodes that does
not have at least one container/list child.

Current implementation generates the wrong payload for JSON
and XML POST requests with leafs or leaf-list in the payload.

With this solution, we can avoid the need to check how many
leaves are in the container and what to do if more of them
are mandatory.

JIRA: NETCONF-1164, NETCONF-1165
Change-Id: I6268ab118fd0cb5092d4b959660855035394e436
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@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
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/mountpoints/MountPointOpenApiTest.java
restconf/restconf-openapi/src/test/resources/openapi-document/controller-all.json
restconf/restconf-openapi/src/test/resources/openapi-document/controller-toaster.json
restconf/restconf-openapi/src/test/resources/openapi-document/device-all.json
restconf/restconf-openapi/src/test/resources/openapi-document/device-toaster.json