With the implementation of toYAML, I realized we could try to dump a hint into the error message.
Here are some error messages that could be investigated in this issue:
- Detect that toYAML has been called (though maybe detection isn't necessary...) and, if a "mapping values not allowed in this context" error occurs, append a suggestion that the toYAML output might need to be piped to autoindent or indent
- If the returned JSON value has lots of escaping with errors like "unexpected "
" in operand", chances are there's trailing whitespace breaking the multiline YAML parsing - If a message like "bad character ..." occurs, it's likely because they're trying to index a map containing a JSON character, in which case they likely need to use the index function.