i can look into this but cannot reproduce
@Test
public void prettySimple() {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final JsonGenerator generator =
Json.createGeneratorFactory(new HashMap<String, Object>() {{
put(JsonGenerator.PRETTY_PRINTING, true);
}}).createGenerator(baos);
generator.writeStartObject().write("firstName",
"John").writeEnd().close();
assertEquals("{\n" +
" \"firstName\":\"John\"\n" +
"}", new String(baos.toByteArray()));
}
Can you provide a failing test?
On Sun, Oct 11, 2015 at 9:33 PM, Romain Manni-Bucau
<[email protected]> wrote:
> Hi guys,
>
> prettifying a json with johnzon leads to empty lines, what do you think
> about it? I'm tempted t get rid of them.
>
> Here is a sample:
>
> ----
> {"foo":"bar"}
> ----
>
> -> with johnzon
>
> -----
>
> {
>
> "foo":"bar"
> }
> ----
>
>
> -> expected
>
> -----
> {
> "foo":"bar"
> }
> ----
>
> If anyone wants to work on it happy to let you hack or I will tackle it
> next week probably.
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
--
Hendrik Saly (salyh, hendrikdev22)
@hendrikdev22
PGP: 0x22D7F6EC