23andMe / Yamale

A schema and validator for YAML.
MIT License
679 stars 88 forks source link

Is there a way to suppress duplicate key errors using ruamel's allow_duplicate_keys in Yamale ? #164

Closed msidana closed 3 years ago

mildebrandt commented 3 years ago

Hi, thanks for using Yamale. As you're probably aware, duplicate keys are not allowed within the yaml specification: https://yaml.org/spec/1.2/spec.html#id2764044

The content of a mapping node is an unordered set of key: value node pairs, with the restriction that each of the keys is unique.

For that reason, Yamale won't be supporting this feature natively.

You may be able to patch the function used for parsing: https://github.com/23andMe/Yamale/blob/master/yamale/readers/yaml_reader.py#L14-L17

Unfortunately, I won't be able to help with the details on patching.