wwkimball/yamlpath

FEATURE REQUEST: Allow passing custom parameters to ruamel.yaml (f.e. to enforce YAML 1.1)

gdubicki opened this issue · 1 comments

Thank you for this project, it looks very promising! :)

Is your feature request related to a problem? Please describe.

I am considering using your library in a project that has been using PyYAML. This means that it's only YAML 1.1-compliant and I would like to not change that for maximum backward compatibility (at least for now). However when I use

def get_yaml_data(
I cannot pass version='1.1' to ruamel.yaml to enforce this.

Describe the solution you'd like

Allow passing extra params to ruamel.yaml.

I am sorry, I haven't done enough investigation here. It looks like it's enough to set:

yaml.version = (1, 1)

...after getting yaml from Parsers.get_yaml_editor() to make the ruamel.yaml use YAML 1.1 by default.