kinnison / marked-data

A YAML representation library which explicitly retains provenance data
MIT License
13 stars 6 forks source link

Option to error / warn on duplicate keys #3

Closed wolfv closed 8 months ago

wolfv commented 8 months ago

I think the current implementation just eats duplicate keys and last-one-wins. It would be nice (for correctness of the parsing / documents) if we could enable a stricter behavior where the parser would error out if it encounters duplicate keys.

I was wondering what you think?

wolfv commented 8 months ago

Made a PR here: https://github.com/kinnison/marked-data/pull/4 I'd also be happy to add an option struct for the loader. Let me know what you think.

kinnison commented 8 months ago

4 was merged, and I've added a #[non_exhaustive] so that future additional errors aren't semver-major.

Version 0.3.0 of marked-yaml has been released.