OAI / Overlay-Specification

The OAI Overlay Specification
Apache License 2.0
49 stars 13 forks source link

Does `update` use "deep merge" or "shallow merge"? #61

Open ralfhandl opened 1 week ago

ralfhandl commented 1 week ago

The Action Object definition currently states that

properties in the merge object replace properties in the target object with the same name

If that is to be the case, then the Structured Overlays Example would replace existing path item objects with sparse and incomplete objects, containing only an incomplete operation object for GET, missing for example the required responses field.

The "Structured Overlays Example" will only work if nested objects within the update object are also merged with their counterpart in the target, recursively. Nested arrays would still have to replace their counterpart in the target, same as primitive values.

ralfhandl commented 2 days ago

Experiments: