Question: I'm having a JSON deserialized from Java as follow: 

**Java**

```
jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(graphDTO);

```

**JSON**

```
  "accounts" : [ {
    "name" : "1009427721",
    "value" : 16850.79,
    "children" : [ {
      "name" : "BITCOIN EARNINGS",
      "value" : 10734.24,
      "children" : [ {
        "name" : "2017",
        "value" : 1037.82,
        "children" : [ {
          "name" : "07",
          "value" : 518.91
        } ]
      } ]
    },  ...

```

The deserialized Java POJO being:

```
public class GraphDTO {

    private Set<Account> accounts = new HashSet<>();

    public Set<Account> getAccounts() {
        return accounts;
    }
}

```

**Questions**

1. How can I remove "accounts" from the generated JSON (first line) ?
2. Injecting the JSON form into JavaScript, I'm getting an encoded form like:
`var data = { &#034;accounts&#034; : [ {` ...
How can I avoid this ?

Answer: 
I don't think it's possible to avoid the `accounts`, but you can do this:

```
jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(graphDTO.getAccounts());

```

We're waiting your way to parse JSON in javascript...
Got it work as follow:

1. Applying the answer of Mohicane:

`mapper.writerWithDefaultPrettyPrinter().writeValueAsString(graphDTO.getAccounts())`
2. Injecting the JSON from Java to JavaScript (in a JSP) with:

`var data = ${graphDTOJSON};`

Many thanks!