ajv-merge-patch icon indicating copy to clipboard operation
ajv-merge-patch copied to clipboard

Feature Proposal: Support arrays of objects to be merged in the "with" property

Open simonmeusel opened this issue 6 years ago • 3 comments

See #15 Fixes #12

I've implemented a simple wrapper function for json merge patch to allow arrays.

simonmeusel avatar Jul 14 '18 14:07 simonmeusel

Coverage Status

Coverage remained the same at 100.0% when pulling 3fd591812634f7876a1e3693c9bdcda79a42e5f0 on simonmeusel:merge-arrays into d8c8c07d01a566408cc6391fab4498aee32532a0 on epoberezkin:master.

coveralls avatar Jul 14 '18 14:07 coveralls

@simonmeusel thanks, I will review over the weekend.

epoberezkin avatar Jul 25 '18 14:07 epoberezkin

I would love to see this merged.

It is very cumbersome to merge multiple schemas for now. Here is my use case:

{
  "$merge": {
    "source": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "with": [
      {
        "$ref": "definitions/color.json#/definitions/color"
      },
      {
        "$ref": "definitions/font.json#/definitions/font"
      }
    ]
  }
}

Any help needed?

lakim avatar Jan 28 '19 15:01 lakim