-1

I have this field in a POJO that is serialized into JSON:

@XStreamAlias("tags")
List<String> tags;

My problem is that the output looks like this:

"tags": [
      {
        "@class": "linked-list",
        "string": [
          "test",
          "test2"
        ]
      }
    ],

In what way that the output would look like this:

"tags": [
          "test",
          "test2"
        ],

Just like this.

quarks
  • 33,478
  • 73
  • 290
  • 513

1 Answers1

0

The solution is to add @XStreamImplicit annotation:

@XStreamImplicit(itemFieldName="tags")
List<String> tags;
quarks
  • 33,478
  • 73
  • 290
  • 513