I have two Jsons I want to merge. Arrays in json should be also merged, not 
concatenated.

Example:
Json 1:
{
  "level1": {
    "value": "a",
    "anotherValue": "z",
    "array1": [
      {
        "value": "b",
        "anotherValue": "z"
      }
    ]
  }
}


Json 2:
{
  "level1": {
    "value": "c",
    "array1": [
      {
        "value": "d"
      }
    ]
  }
}

After merge, I want to get:
{
  "level1": {
    "value": "c",
    "anotherValue": "z",
    "array1": [
      {
        "value": "d",
        "anotherValue": "z"
      }
    ]
  }
}


Using code from this suggestion about json merge 
<https://stackoverflow.com/questions/9895041/merging-two-json-documents-using-jackson>,
 
I got array1 not merged, but concatenated:
{
  "level1": {
    "value": "c",
    "anotherValue": "z",
    "array1": [
      {
        "value": "b",
        "anotherValue": "z"
      },
      {
        "value": "d",
        "anotherValue": "z"
      }
    ]
  }
}


How do I achieve arrays in json being merged, not concatenated?

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to