-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Avoid language that seems to attempt to modify JSON parsing behavior #1284
Comments
I'm not sure that this affects us. We still maintain the ability to treat
|
@gregsdennis it seems I was unclear. None of this is about what JSON Schema does or does not support. To some folks with deep experience with IETF specification language in general and the JSON RFC in particular, the language in question imposes a requirement on JSON parsers, which are governed by RFC 8259, not us. This interpretation depends on how one understands the word "encoding", but I'm going to take the JSON working group's reading as reasonable. Therefore, the language must be changed. As far as how people write integers, it is entirely valid for a spec to recommend the most interoperable way to do so. This does not mean we can control what they do, we just tell them what is most likely to work in the broadest circumstances. Here is an example from the JSON RFC:
This doesn't mean that people can't use numbers outside of that range, or that they will never be interoperable. It just advises that numbers within that range will behave the same for all conforming implementations. Similarly, it's possible that something or other (possibly not even a JSON parser since data might be put into the data model from a non-JSON source) might, for example, parse |
So is the suggestion to make that text read more as setting an expectation for validators? |
I honestly do not care. Someone should take out the problematic language, this is already more time than I care to spend on integer representation. |
This was done at some point, but I can find no record of when (I didn't search very hard). |
This discussion on the IETF JSON mailing list brought up that this language in §6.3 Mathematical Integers is problematic:
It appears to impose a normative (SHOULD NOT) requirement on JSON parsers, which is not something we can do.
I think that the intent of this was to guide users of JSON Schema to write integers (both in JSON data and in JSON Schema keyword values) as
1
rather than1.0
, as doing so maximizes the chances that a JSON parser will store the value as an integer rather than a float in an environment that makes such distinctions.The text was updated successfully, but these errors were encountered: