-
Notifications
You must be signed in to change notification settings - Fork 96
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
Request for I-JSON (RFC 7493) Parsing Mode #127
Comments
It is very likely that we already follow these rules. If so, we should document it. If not, we should consider whether to follow it. |
The only normative requirement we don't comply with is checking for duplicate object key. There is some normative encouragements in there that we don't strictly follow, such as limiting precision. |
We never emit JSON with duplicates, as the DOM (via |
The restriction of allowing only a single object key is during the parsing, not emission. |
When an object is constructed during parsing, we check its elements for duplicates here: |
@vinniefalco To conform to I-JSON we would have the check for duplicate keys within |
Fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuck |
|
One way to implement that in your codebase I see is to throw in case of duplicate in here: https://github.com/CPPAlliance/json/blob/ec29dfa768a16672534f758005dfe4841a8ea93d/include/boost/json/detail/impl/object_impl.ipp#L79 And handle that exception upward to report that the provided I-JSON document is ill-formed. This will require adding an option to parse_options to allow the user to parse in "I-JSON" mode and require you to remove |
Actually, when we detect a duplicate we can set a bit somewhere in the |
That can work too, yeah. |
We should target this for the middle of year release? |
I was wondering if there is any interest in implementing the I-JSON parsing mode for boost.json. I-JSON is an interoperable version of JSON which aims to remove some ambiguities in the parsing. The changes required for such a compliance are listed in Section 2 of the document.
The text was updated successfully, but these errors were encountered: