OpenApi: Remove incorrect list POST requests 37/108637/2
authorSamuel Schneider <samuel.schneider@pantheon.tech>
Tue, 24 Oct 2023 13:57:04 +0000 (15:57 +0200)
committerOleksandr Zharov <oleksandr.zharov@pantheon.tech>
Tue, 31 Oct 2023 10:36:19 +0000 (11:36 +0100)
commita112b8d04bb0f550653baefd7fa9cf62e1c72c36
tree909534bca4868cc7e0ce915849831ca3b0d150cd
parentb3e9dde5bb2810407c35a508482f260ee479ec5d
OpenApi: Remove incorrect list POST requests

Our logic creates POST requests for lists with keys, containing
multiple resources in payload. This does not align with the expected
structure for creating child resources in the YANG model.

Added condition that prevents the creation of POST requests
that has list as a last element.

JIRA: NETCONF-1101
Change-Id: I46820f222c9c5ef8078ac8675d2adc12b06f1253
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
(cherry picked from commit 1d64392feb896e9c74f4d9085eea52bbfdac1211)
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/BaseYangSwaggerGenerator.java
restconf/sal-rest-docgen/src/test/java/org/opendaylight/netconf/sal/rest/doc/impl/ApiDocGeneratorRFC8040Test.java
restconf/sal-rest-docgen/src/test/java/org/opendaylight/netconf/sal/rest/doc/impl/ListPostRequestsTest.java [new file with mode: 0644]
restconf/sal-rest-docgen/src/test/java/org/opendaylight/netconf/sal/rest/doc/impl/PostPayloadTest.java
restconf/sal-rest-docgen/src/test/resources/yang/list-post.yang [new file with mode: 0644]