A leaf value: string, number, boolean, or null.
A JSON array, combined wholesale -- one input's whole array wins.
A JSON array, combined element-by-element: every input's array
concatenated in input order ('concat'), optionally deduplicated by deep
equality ('concat-unique'). sortBy (optional) sorts the result
afterwards by a named field, for arrays of objects; omitted, the result
keeps concatenation order.
If any input's value at this key is not an array, the whole node falls
back to 'first' (see the module-level type-mismatch note).
A JSON array of objects, where elements sharing the same value at key
across (and within) inputs are the same logical entry and are combined
using item. item is required: defaulting it to wholesale 'first'
would make this strategy behave exactly like 'concat-unique' on the
outer array minus true duplicates, silently defeating the reason to pick
this strategy over that one.
Elements whose key value appears only once across every input's array
pass through unchanged (via item applied to a single-element group).
Output order is first-seen order across all inputs, flattened -- there is
no sortBy here, because preserving first-seen order is this strategy's
point, not an accident of it.
If any input's value is not an array, or any element is not an object
carrying a string/number/boolean value at key, the whole node falls
back to 'first'.
A JSON object, combined wholesale -- one input's whole object wins.
A JSON object, combined field by field. A field not listed in fields
defaults to 'first', applied to that field's value wholesale regardless
of its own shape -- an unconfigured field is never guessed at.
If any input's value at this key is not a plain object, the whole node
falls back to 'first'.
Configuration for how to combine one document-root
x-*extension's value across inputs (proposal 48, generalising issue #60).A node mirrors one point in the extension value's own JSON shape:
kindsays what shape is expected there,strategysays how to combine it. Left unconfigured (the extension key absent from ExtensionMergeStrategies, or a field absent from anobject/mergenode'sfields), a value is taken wholesale from whichever input declared it first -- today's behaviour, unchanged.kindis declarative-only for'first'/'last'/'error': those three operate on a value of any shape, so ascalarnode with strategy'error'still fails on disagreement even if the actual value turns out to be an object. Checkingkindthere and silently falling back on a mismatch would mean the one strategy whose entire purpose is "tell me about disagreement" could disagree and say nothing -- the worst version of the type-mismatch fallback below.kindonly gates behaviour for the strategies that inspect internal structure (concat,concat-unique,union-by-key,merge), where there is no sensible operation to fall back to except'first'.