Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate keys should cause an error #68

Open
mhauru opened this issue Oct 25, 2022 · 0 comments
Open

Duplicate keys should cause an error #68

mhauru opened this issue Oct 25, 2022 · 0 comments

Comments

@mhauru
Copy link

mhauru commented Oct 25, 2022

The YAML spec says that a mapping is "an unordered association of unique keys to values". ocaml-yaml seems to accept duplicate keys and just picks the first value:

utop # Yaml.of_string "{dada: 0, dada: 1}" |> Result.get_ok |>  Yaml.Util.find_exn "dada";;
- : Yaml.value option = Some (`Float 0.)

I would propose checking for duplicate keys and treating them as invalid YAML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant