0

In general, jackson is serialize beans to standard json format, for example, the following class:

public class Person {
    private String name;
    private int age;
    // getter/setter
}

will serialize to following json:

{
  "name" : "test1111",
  "age" : 18
}

but i want to get the format like this(non-standard):

{
  name : test1111,
  age : 18
}

that is to say, i didn't want to output the double-quote despite of the type. Thanks for help in advance!

MikanMu
  • 21
  • 4

1 Answers1

0

That is not valid JSON and therefore you cannot use Jackson to generate it.

If you want, you can use Jackson to generate a String value of

{
  "name" : "test1111",
  "age" : 18
}

and then manually remove the quotes.

Sotirios Delimanolis
  • 274,122
  • 60
  • 696
  • 724