chyh1990 / yaml-rust

A pure rust YAML implementation.
Apache License 2.0
611 stars 141 forks source link

add warning when duplicate hashmap key #185

Open higuruchi opened 2 years ago

higuruchi commented 2 years ago

Close: #174

Add warning when duplicate hashmap key

puetzp commented 2 years ago

Hey there, I wonder if insert_new_node should return a ScanError instead of a waning in case of encountering a duplicate key. It seems to me that the YAML 1.2 spec contains numerous sections that mention the requirement of key uniqueness in mappings, which would indicate a "hard" error.

davvid commented 10 months ago

:+1: on the above, and also note that since this is library code we shouldn't really be printing anything.

I'd be more than happy to accept a PR that makes duplicate keys an error in my fork: https://github.com/davvid/yaml-rust