Verify correct value type in YangPatch body 31/115831/34
authorPeter Suna <peter.suna@pantheon.tech>
Mon, 10 Mar 2025 18:33:52 +0000 (19:33 +0100)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Wed, 7 May 2025 12:00:12 +0000 (12:00 +0000)
commit90710b29f063e687b91841cdb7b9436ac34765e2
tree488eb83d29fefcd8f6866f1ff8f520102d992039
parent6ac53d4bd8fcbd3c01d63ecaba23678872918e14
Verify correct value type in YangPatch body

If the provided JSON input is not a string and is recognized
as BEGIN_ARRAY, BEGIN_OBJECT, or NULL, calling in.nextString()
will produce an IllegalStateException, like:
IllegalStateException: Expected a string but was BEGIN_ARRAY

Verify that the provided JSON input is a string. If the input
is not a string, raise a RequestException.

JIRA: NETCONF-1438
Change-Id: Ica4a9ab93c3fcff85842eceaa6e9bbe9c81b15ef
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
protocol/restconf-server-api/src/main/java/org/opendaylight/restconf/server/api/JsonPatchBody.java
protocol/restconf-server-jaxrs/src/test/java/org/opendaylight/restconf/server/jaxrs/NC1438Test.java