EsotericSoftware / jsonbeans

Java object graphs, to and from JSON automatically
BSD 3-Clause "New" or "Revised" License
91 stars 30 forks source link

Json.prettyPrint() only supports objects, not arrays #2

Closed ghost closed 8 years ago

ghost commented 10 years ago

From Robert.E...@gmail.com on February 23, 2013 17:19:32

JSON text can either be an object or array for the "top-level" object, but JSON.prettyPrint() only works for objects. See http://www.ietf.org/rfc/rfc4627.txt. What steps will reproduce the problem?

  1. Try to pretty-print something like '[ "one": "value", "bool": true ]'
  2. Get an error What is the expected output? What do you see instead? Expected pretty printing to work, but it didn't. What version of the product are you using? On what operating system? Latest binary build.

Original issue: http://code.google.com/p/jsonbeans/issues/detail?id=2

NathanSweet commented 8 years ago

Works with latest.