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

Misleading text about duplicate keys in JSON #140

Closed
vfaronov opened this issue Mar 6, 2019 · 1 comment · Fixed by #141
Closed

Misleading text about duplicate keys in JSON #140

vfaronov opened this issue Mar 6, 2019 · 1 comment · Fixed by #141

Comments

@vfaronov
Copy link
Contributor

vfaronov commented Mar 6, 2019

Zerolog documentation says:

JSON accepts dup keys, the last one prevails

But the JSON standard says:

The names within an object SHOULD be unique.
[...] When the names within an object are not
unique, the behavior of software that receives such an object is
unpredictable. Many implementations report the last name/value pair
only. Other implementations report an error or fail to parse the
object, and some implementations report all of the name/value pairs,
including duplicates.

Probably this is not an issue in practice, but then the docs should be rephrased along the lines of “Software accepting JSON logs will typically honor the last one”.

@rs
Copy link
Owner

rs commented Mar 8, 2019

Can you submit a PR?

@rs rs closed this as completed in #141 May 26, 2019
rs pushed a commit that referenced this issue May 26, 2019
Per RFC 8259 Section 4, behavior on duplicate keys is unspecified.

Fixes #140.
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