When loading YAML anchors in node.js (v4.8.7) using the js-yaml 3.10.0 package (there's a nice example of using it here) I get the following error:
"cannot merge mappings; the provided source object is unacceptable"
For instance in my input yaml file I have something like the following as my anchor:
defaultEd: &defaultEd
- 'Pennsylvania College of Technology AS'
- 'Pennsylvania College of Technology BS'
And where the anchor is referenced in my input yaml file I have the following:
...
education:
<<: *defaultEd
qs:
- 'Reading'
- 'Writing'
...
I'm hoping to accomplish the following in my output:
education:
- 'Pennsylvania College of Technology AS'
- 'Pennsylvania College of Technology BS'
The error is displayed something like this:
{ [YAMLException: cannot merge mappings; the provided source object is unacceptable at line 21, column 1:
qs:
^]
name: 'YAMLException',
reason: 'cannot merge mappings; the provided source object is unacceptable',
mark:
Mark {
name: null,
buffer: 'defaultEd: &defaultEd\n - \'Pennsylvania College of Technology AS\'\n - \'Pennsylvania College of Technology BS..
<<: *defaultEd\nqs:\n - \'Reading\'\n - \'Writing\'\n - \'Rithmatick\'\nexperience:\n - {posName: \'Database Analyst / Net Tech\', companyName: \'Choices People Supporting People\'}\n\u0000',
position: 435,
line: 20,
column: 0 },
message: 'cannot merge mappings; the provided source object is unacceptable at line 21, column 1:\n qs:\n ^' }
Error View file does not exist: someTest.yml