Skip to content

Stringify: My merge keys are surrounded with quotes "" #438

Closed Answered by eemeli
alexbjorlig asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like you're trying to create a YAML alias, but you're getting a YAML scalar because the input value *section is getting escaped to avoid having it parsed as an alias. This is intentional, as otherwise the resulting YAML document would be invalid.

When working with a YAML.Document object, you could manually create an alias with new YAML.Alias() and enter it into the document contents with something like doc.setIn(['model', 0, 'cc', '<<'], ...), but stringifying this will fail if the document does not also include the anchor for the alias. This is why the doc.createAlias() utility method is provided, as it'll ensure that the source has an anchor matching the alias.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alexbjorlig
Comment options

Answer selected by eemeli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants