Fix JSON and XML PatchBodyWriter errors output 87/107687/21
authorMatej Sramcik <matej.sramcik@pantheon.tech>
Mon, 4 Sep 2023 07:58:51 +0000 (09:58 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Thu, 9 Nov 2023 09:13:42 +0000 (09:13 +0000)
commit54cc4550da43ea6b553a8bd81a58e1aeffcbef03
treedb79b36588b7e250229af7c8d251728fce506824
parent3a131d1ebe983754661b6ca1889e61f677998c2e
Fix JSON and XML PatchBodyWriter errors output

When an error occurs on commit the result displays a global error
together with per-operation status, which is confusing and self
contradicting.

JsonPatchBodyWriter and XmlPatchBodyWriter edited to omit
per-operation status if global error is present.

Added tests for this behavior.

JIRA: NETCONF-1176
Change-Id: I228754e75189e8475fbd32fa0cb57272b35f654a
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/JsonPatchStatusBodyWriter.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlPatchStatusBodyWriter.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/JsonPatchStatusBodyWriterTest.java [new file with mode: 0644]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlPatchStatusBodyWriterTest.java [new file with mode: 0644]