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

Feature request: allow_dupkeys #122

Closed
Grinnz opened this issue Feb 14, 2019 · 5 comments
Closed

Feature request: allow_dupkeys #122

Grinnz opened this issue Feb 14, 2019 · 5 comments

Comments

@Grinnz
Copy link

Grinnz commented Feb 14, 2019

As a result of #75 duplicate keys in parsed JSON throw an exception. Relaxed mode allows duplicate keys, but there is no way to allow duplicate keys without turning on relaxed mode. Unlike the other syntax allowed by relaxed mode, duplicate keys are still valid (the spec only says that keys SHOULD be unique). In addition, JSON::PP, JSON::XS, and Mojo::JSON all allow duplicate keys, so this option would help with cross compatibility.

@rurban
Copy link
Owner

rurban commented Feb 15, 2019 via email

@Grinnz
Copy link
Author

Grinnz commented Feb 15, 2019

There's no option that I can find:

> perl -MCpanel::JSON::XS -E'say Cpanel::JSON::XS->VERSION; Cpanel::JSON::XS->new->allow_dupkeys'
4.08
Can't locate object method "allow_dupkeys" via package "Cpanel::JSON::XS" at -e line 1.

@rurban
Copy link
Owner

rurban commented Feb 15, 2019

Oops, I see. I went with the shortcut: "relaxed implements allow_dupkeys"
That needs to be added separately of course. Thanks for notifying!

rurban added a commit that referenced this issue Feb 15, 2019
requested by @Grinnz
Fix allow_dupkeys on the slow decode_hv path also, covered by
one new test.
rurban added a commit that referenced this issue Feb 15, 2019
requested by @Grinnz
Fix allow_dupkeys on the slow decode_hv path also, covered by
one new test.
@rurban
Copy link
Owner

rurban commented Feb 15, 2019

Done with 4.09

@rurban rurban closed this as completed Feb 15, 2019
@Grinnz
Copy link
Author

Grinnz commented Feb 15, 2019

Thanks!

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

2 participants