Skip to content

Patching nested YAML map values incorrectly #5

@lotem

Description

@lotem

In *.custom.yaml, values from the immediate children key-value pairs under the node patch: will substitute values with the same key-path from the YAML document.
It's important to specify in the patch a key-path separated with / for values in a nested YAML map.

For example, the following code in RimeConfigController.m:

[_squirrelConfig patchValue:_colorTheme forKeyPath:@"style.color_scheme" error:&error];

generates an incorrect patch

patch:
  style:
    color_scheme: blah

which should be:

patch:
  "style/color_scheme": blah

The problem with the former patch is, other children of the node style would be lost in the patched file, since the YAML value to be patched is the entire map (ROOT)/style.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions