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

option to throw on duplicate keys for .parse #26

Open
silverwind opened this issue Nov 25, 2016 · 1 comment · May be fixed by #31
Open

option to throw on duplicate keys for .parse #26

silverwind opened this issue Nov 25, 2016 · 1 comment · May be fixed by #31

Comments

@silverwind
Copy link

silverwind commented Nov 25, 2016

RFC7159 says:

The names within an object SHOULD be unique

Despite that, pretty much all implementations of JSON.parse handle them gracefully, which creates an issue when one tries to be compatibly with YAML where duplicate keys are generally a fatal error.

I think it'd be great if this parser had an option to be strict on duplicate keys.

@silverwind silverwind changed the title option to throw on duplicate keys option to throw on duplicate keys for .parse Nov 25, 2016
@prantlf
Copy link

prantlf commented Jun 1, 2019

I opened PR #31 as a suggested fix for this issue.

@prantlf prantlf linked a pull request Jun 1, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants