avian2 / jsonmerge

Merge a series of JSON documents.
MIT License
214 stars 25 forks source link

Feature Request - Merge a single array element into all elements of an array. #56

Closed wilcox-liam closed 2 years ago

wilcox-liam commented 2 years ago

Merge Strategy to merge an single element into all elements of an array.

BASE

{
  "table": [{
    "schema": "my_schema"
  }]
}

HEAD

{
  "tables": [
    {
      "name": "my_table"
    },
    {
      "name":"my_other_table"
    }
  ]
}

OUTPUT

{
  tables: [
    {
      "name": "my_table",
      "schema": "my_schema"
    },
    {
      "name":"my_other_table",
      "schema": "my_schema"
    }
  ]
}