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

Decoding error #16

Open
eadmund opened this issue Jun 12, 2016 · 0 comments
Open

Decoding error #16

eadmund opened this issue Jun 12, 2016 · 0 comments

Comments

@eadmund
Copy link

eadmund commented Jun 12, 2016

Per the ECMAScript spec, Section 15.12.2, at the bottom of pg. 204 'In the case where there are duplicate name Strings within an object, lexically preceding values for the same key shall be overwritten.' This behaviour is relied upon by RFC 7517, e.g. Section 5 'The member names within a JWK Set MUST be unique; JWK Set parsers MUST either reject JWK Sets with duplicate member names or use a JSON parser that returns only the lexically last duplicate member name, as specified in Section 15.12 ("The JSON Object") of ECMAScript 5.1 [ECMAScript].

However, cl-json returns both values for a duplicate key:

(json:decode-json-from-string "{\"foo\": 1, \"foo\": 2}") ((:foo . 1) (:foo . 2))

I think it'd be possible to hack something together with a customised decoder, but it's probably better to handle this by default.

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