BUG 8927: Netconf response payload fails to render in JSON 84/63984/13
authorTomas Cere <tcere@cisco.com>
Tue, 3 Oct 2017 10:36:26 +0000 (12:36 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 19 Oct 2017 15:51:15 +0000 (15:51 +0000)
commitaf34365bd494ba4a6bb5a308f304ea9b30a29434
tree3de08e18555d6c038f7262e90a230e613c60bf7c
parent8a9f67dadf2cec5a0844343e55163c4caace0866
BUG 8927: Netconf response payload fails to render in JSON

JSONNormalizedNodeStreamWriter does not write a content of anyXml nodes
correctly mainly due to Text nodes containing whitespaces before, between
or after Element nodes. Therefore the first Text node only was serialized
to JSON and the rest of anyXML content was missing.
This patch provides fix of anyXml content serialization to JSON.

Change-Id: I74f34aecec1a85b2ede4be63e5b6dd74522981e4
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONNormalizedNodeStreamWriter.java
yang/yang-data-codec-gson/src/test/java/org/opendaylight/yangtools/yang/data/codec/gson/AnyXmlSupportTest.java
yang/yang-data-codec-gson/src/test/java/org/opendaylight/yangtools/yang/data/codec/gson/TestUtils.java
yang/yang-data-codec-gson/src/test/resources/bug8927/json/expected.json [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/xml/input.xml [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/complexjson/yang/bug8927.yang [new file with mode: 0644]