[CONTROLLER-923] ?prettyPrint=true is ignored Created: 06/Oct/14  Updated: 14/Nov/17  Resolved: 16/Jun/15

Status: Verified
Project: controller
Component/s: restconf
Affects Version/s: Helium
Fix Version/s: None

Type: Bug
Reporter: Vratko Polak Assignee: Jan Hajnar
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


External issue ID: 2153

 Description   

The fix to CONTROLLER-477 introduced URI parameter prettyPrint. The code from https://git.opendaylight.org/gerrit/#/c/8329 is still there, but since then codecs were moved to yangtools, and logic to detect prettyPrint was not moved properly. This example from gerrit (with new restconf port) thus now fails to result in formatted output:
http://localhost:8181/restconf/config/opendaylight-inventory:nodes?prettyPrint=true



 Comments   
Comment by Jozef Gloncak [ 14/Oct/14 ]

CONTROLLER-923 - yangtools pretty print for json output
https://git.opendaylight.org/gerrit/#/c/11937/

CONTROLLER-923 - sal-rest-connector - integration of prettyPrint URI parameter recognition.
https://git.opendaylight.org/gerrit/11938 [DRAFT]

currently working on pretty print for xml output

Comment by Jozef Gloncak [ 16/Oct/14 ]

CONTROLLER-923 - pretty print in xml
https://git.opendaylight.org/gerrit/12002

should be used some other (simpler writer)

Comment by Jozef Gloncak [ 17/Oct/14 ]

https://git.opendaylight.org/gerrit/#/c/11938/4 - changes in sal-rest-connector [DRAFT]
https://git.opendaylight.org/gerrit/#/c/11937/ - changes in yang-data-codec-gson

XML indentation isn't done in yang-data-impl but directly in sal-rest-connector in class NormalizedNodeXmlBodyWriter in method writeTo(). If indentation is required then prepared entityStream (parameter of writeTo() method) is red and transformed to new input stream which is then transformed via Transformer class to indented output.

Comment by Jozef Gloncak [ 17/Oct/14 ]

In NormalizedNodeXmlBodyWriter class method writeTo() was changed.
IndentingXMLStreamWriter implementation of XmlStreamWriter is used.

Comment by Jozef Gloncak [ 15/Jan/15 ]

both patches (yangtools and controller) for JSON
were rebased

Comment by Vratko Polak [ 05/Feb/15 ]

Still not fixed, I guess Target Milestone should be changed.

Considering the default value for prettyPrint, current state is that regular responses are not indented, but responses with errors are indented.
If this is the desired behavior, it should be documented somewhere. If not, fix of this bug should set desired default values.

Comment by Jan Hajnar [ 26/May/15 ]

patch:
https://git.opendaylight.org/gerrit/#/c/20877/

Comment by Vratko Polak [ 16/Jun/15 ]

Verified to be fixed (for regular data, both XML and JSON) on Lithium RC1 2015-06-16 build.

Generated at Wed Feb 07 19:54:13 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.