Skip to content

Keep yaml-patch state in sync for later yaml-edit fences #359

Description

@dajiaohuang

createYamlTransform forwards yaml-patch operations to the renderer, but its internal currentSpec snapshot is only updated for add, replace, and remove. A valid RFC 6902 move or copy therefore leaves the base used by subsequent yaml-edit fences stale.

Reproduction:

```yaml-patch
{"op":"add","path":"/a","value":1}
```
```yaml-patch
{"op":"move","from":"/a","path":"/b"}
```
```yaml-edit
b: null
```

The final edit should remove /b, but createYamlTransform currently emits only the add and move patches. The renderer now has /b, while the transform's currentSpec still has /a, so the merge edit sees no b key to remove.

Please keep the transform snapshot synchronized with RFC 6902 operations before applying later edit fences, and add a regression test for a move followed by a yaml-edit of the destination.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions