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

Canonical JSON: 0 vs -0 #1566

Closed
tonyg opened this issue Jun 13, 2023 · 2 comments · Fixed by #1573
Closed

Canonical JSON: 0 vs -0 #1566

tonyg opened this issue Jun 13, 2023 · 2 comments · Fixed by #1573
Labels
clarification An area where the expected behaviour is understood, but the spec could do with being more explicit help wanted Interested in contributing to the spec? These would be great additions!

Comments

@tonyg
Copy link
Contributor

tonyg commented Jun 13, 2023

Link to problem area: https://spec.matrix.org/v1.7/appendices/#canonical-json

Issue

In spec v1.7, in the "canonical JSON" appendix, it looks like both 0 and -0 are allowed (both integers in range, leading minus permitted for all integers). -0 should probably be explicitly disallowed.

@tonyg tonyg added the clarification An area where the expected behaviour is understood, but the spec could do with being more explicit label Jun 13, 2023
@richvdh
Copy link
Member

richvdh commented Jun 14, 2023

Agreed. I think this is just an omission from the words of the spec. A PR to fix it would be welcome.

As an aside: RFC8785 (a similar attempt at JSON Canonicalisation) doesn't seem to specify this either (though its job is harder because it tolerates floats),.

Related: #1245

@richvdh richvdh added the help wanted Interested in contributing to the spec? These would be great additions! label Jun 14, 2023
@tonyg
Copy link
Contributor Author

tonyg commented Jun 14, 2023

Thanks. Here's a PR: #1573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification An area where the expected behaviour is understood, but the spec could do with being more explicit help wanted Interested in contributing to the spec? These would be great additions!
Projects
None yet
2 participants