Fix patch target parsing 10/97210/10
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 13 Aug 2021 20:28:24 +0000 (22:28 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 14 Aug 2021 12:14:47 +0000 (14:14 +0200)
commit845f511527e22741a1cf1053b04250d16bf7f6a0
tree5f9c4f446530cf911db004157ecd78dfcff1c8bf
parentc75fc716f8c60dfdf267d078df66346c95dae7a4
Fix patch target parsing

Our tests were not updated for RFC8040, hence they are written with
weird codecs which utterly do not match RFC8072 definition of
yang-patch.

The problem is that patch edit's target is interpreted in terms of an
extension to the URL, i.e. it does NOT follow JSON nor XML parsing
rules, nor is it anything in-between -- we must use ParserIdentifier's
facilities.

Update the parsers and the test suites, ditching a lot of complexity
in process of doing so.

JIRA: NETCONF-804
Change-Id: If9d9c77e0e2397ffdcb8e8c0f0fef0b9b02bac8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlPatchBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/ParserIdentifier.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReaderMountPointTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlPatchBodyReaderMountPointTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlPatchBodyReaderTest.java
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnList.json
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHSimpleLeafValue.json
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdata.json
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdata.xml
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml