Skip to content

Commit b987b53

Browse files
committed
docs: ports relevant suggestions from baywet#1
@mikeschinkel Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
1 parent 29b802d commit b987b53

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/overlay.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The main purpose of the Overlay Specification is to provide a way to repeatably
2121

2222
### Overlay
2323

24-
An Overlay is a JSON or YAML structure containing an ordered list of [Action Objects](#overlay-actions) that are to be applied to the target document. Each [Action Object](#action-object) has a `target` property and a modifier type (`update` or `remove`). The `target` property is a [[RFC9535|JSONPath]] query expression that identifies the elements of the target document to be updated and the modifier determines the change.
24+
An Overlay is a JSON or YAML structure containing an ordered list of [Action Objects](#overlay-actions) that are to be applied to the target document. Each [Action Object](#action-object) has a `target` property and a modifier type (`update`, `remove` or `copy`). The `target` property is a [[RFC9535|JSONPath]] query expression that identifies the elements of the target document to be updated and the modifier determines the change.
2525

2626
## Specification
2727

@@ -270,11 +270,11 @@ This approach allows inversion of control as to where the Overlay updates apply
270270

271271
#### Copy example
272272

273-
Copy actions behave similarly to update actions but source the node to from the document being transformed. Copy actions MAY be used in sequence with update or remove actions to perform more advanced transformations like moving or renaming nodes.
273+
Copy actions behave similarly to `update` actions but source the node to from the document being transformed. Copy `actions` MAY be used in sequence with `update` or `remove` actions to perform more advanced transformations like moving or renaming nodes.
274274

275275
##### Simple copy
276276

277-
The following example demonstrates how the operations from the "items" path item are copied to the "some-items" path item.
277+
This example shows how to copy all operations from the `items` path item to the `some-items` path item.
278278

279279
###### Source description
280280

@@ -335,7 +335,7 @@ paths:
335335

336336
##### Ensure the target exists and copy
337337

338-
The following example demonstrates how the operations from the "items" path item are copied to the "other-items" path item, while ensuring the "other-items" path item exists first by using an update action.
338+
This example shows how to copy all operations from the `items` path item to the `other-items` path item after first ensuring the target exists with an update action.
339339

340340
###### Source description
341341

@@ -399,12 +399,11 @@ paths:
399399

400400
##### Move example
401401

402-
The following example demonstrates how the "items" path item is renamed as "new-items" through a combination of actions:
403-
404-
1. An update action to ensure the target exists.
405-
1. A copy action to copy the source path item object to the target.
406-
1. A remove action to remove the source path item.
402+
This example shows how to rename the `items` path item to `new-items` using a sequence of overlay actions:
407403

404+
1. Use an `update` action to ensure the target path item exists.
405+
2. Use a `copy` action to copy the source path item to the target.
406+
3. Use a `remove` action to delete the original source path item.
408407

409408
###### Source description
410409

@@ -440,7 +439,7 @@ actions:
440439
copy: '$.paths["/items"]'
441440
- target: '$.paths["/items"]'
442441
remove: true
443-
description: 'moves/rename the "items" path item to "new-items"'
442+
description: 'moves (renames) the "items" path item to "new-items"'
444443
```
445444

446445
###### Result description

0 commit comments

Comments
 (0)