YANGTOOLS-804: Netconf payload fails to render in JSON for anyxml 58/71058/8
authorBalaji Varadaraju <bvaradar@luminanetworks.com>
Tue, 17 Apr 2018 23:08:32 +0000 (18:08 -0500)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 16 May 2018 15:12:58 +0000 (17:12 +0200)
commit4a8280dbad8a080d4b5253e25fc68ec279a3d99d
treea0fd47e4b35c493cd6c379df17db6ca27223ab25
parent968b41a1c1f7f9f435248015926cdaa063b277f5
YANGTOOLS-804: Netconf payload fails to render in JSON for anyxml

When a YANG model contains an anyxml element the output does not render correctly
in JSON in Restconf. XML output works however. Upon investigation we found issue
was with recognising and handling collections in XML. This patch addresses the
same and also enhanced and added more unit tests.

Change-Id: Icb238dd95a3b9af9c4d0f48ff673a7c285925364
Signed-off-by: Balaji Varadaraju <bvaradar@luminanetworks.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 files changed:
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/resources/bug8927/json/complex_array.json [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/json/complex_array_with_other_elements.json [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/json/composite.json [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/json/scalar_array.json [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/json/scalar_array_with_other_elements.json [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/xml/complex_array.xml [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/xml/complex_array_with_other_elements.xml [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/xml/input4.xml [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/xml/scalar_array.xml [new file with mode: 0644]
yang/yang-data-codec-gson/src/test/resources/bug8927/xml/scalar_array_with_other_elements.xml [new file with mode: 0644]