Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Take this example:

Code Block
languagejs
titleParent
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "a",
    "b",
  ]
}


Code Block
languagejs
titleParent
{
  "key1": "1",
  "key3": [
    "c"
  ],
  "key4": "d"
}

The result is then:

Code Block
languagejs
titleResult
{
  "key1": "1",
  "key2", "b",
  "key3": [
    "a",
    "b",
    "c"
  ],
  "key4": "d"
}

...

But, it is also possible to change this behavior - if the child contains the array json.config.override  then the behavior changes and instead we start with the parent but then completely override the specified elements, adding any new elements - meaning the result becomes like this:


Code Block
languagejs
titleParent
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "a",
    "b",
  ]
}


Code Block
languagejs
titleParent
{
  "config.override": [
    "key3"
  ],
  "key1": "1",
  "key3": [
    "c"
  ],
  "key4": "d"
}

The result is then:

Code Block
languagejs
titleResult
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "c"
  ],
  "key4": "d"
}

...