Skip to content

Commit cbac889

Browse files
committed
feat: adds a copy action
1 parent 13b0a70 commit cbac889

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/overlay.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ This object represents one or more changes to be applied to the target document
114114
| Field Name | Type | Description |
115115
| ---- | :----: | ---- |
116116
| <a name="action-target"></a>target | `string` | **REQUIRED** A JSONPath expression selecting nodes in the target document. |
117+
| <a name="action-copy"></a>copy | `string` | A JSONPath expression selecting locations to copy target nodes to in the target document. If the `target` selects an object node, the value of this field MUST be an object with the properties and values to merge with the selected node. If the `target` selects an array, the value of this field MUST be an entry to append to the array. This field has no impact if the `remove` field of this action object is `true` or if the `update` field contains a value. If the `target` selects multiple nodes, the values will be copied sequentially with each node selected by the `copy` expression. |
117118
| <a name="action-description"></a>description | `string` | A description of the action. [[CommonMark]] syntax MAY be used for rich text representation. |
118-
| <a name="action-update"></a>update | Any | If the `target` selects an object node, the value of this field MUST be an object with the properties and values to merge with the selected node. If the `target` selects an array, the value of this field MUST be an entry to append to the array. This field has no impact if the `remove` field of this action object is `true`. |
119+
| <a name="action-update"></a>update | Any | If the `target` selects an object node, the value of this field MUST be an object with the properties and values to merge with the selected node. If the `target` selects an array, the value of this field MUST be an entry to append to the array. This field has no impact if the `remove` field of this action object is `true` or if the `copy` field contains a value. |
119120
| <a name="action-remove"></a>remove | `boolean` | A boolean value that indicates that the target object or array MUST be removed from the the map or array it is contained in. The default value is `false`. |
120121

121122
The result of the `target` JSONPath expression MUST be zero or more objects or arrays (not primitive types or `null` values).
@@ -126,6 +127,8 @@ Primitive-valued items of an array cannot be replaced or removed individually, o
126127

127128
The properties of the `update` object MUST be compatible with the target object referenced by the JSONPath key. When the Overlay document is applied, the properties in the `update` object are recursively merged with the properties in the target object with the same names; new properties are added to the target object.
128129

130+
The properties of the resolved `copy` object MUST be compatible with the target object referenced by the JSONPath key. When the Overlay document is applied, the properties in the resolved `copy` object are recursively merged with the properties in the target object with the same names; new properties are added to the target object.
131+
129132
This object MAY be extended with [Specification Extensions](#specification-extensions).
130133

131134
### Examples

0 commit comments

Comments
 (0)