-
Notifications
You must be signed in to change notification settings - Fork 59
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
RFC 7159 compliancy #34
Comments
Cool. |
This is a great test suite, and yojson doesn't have any. Would you like to leave a script that would fetch and run this test suite? |
I'll add the successful ones to the current test suite and the rest of the test cases to a separate one. Then we can start fixing the ones worth fixing and migrate them from one test suite to the other to ensure we don't break compliance in the future. |
The crashes were all fixed by #35, so only the |
Yeah I just ran the test suite I added right now with
I'll polish the test suite a bit to get a better output on the failures and get it merged so we have something to work on. |
It seems like it's a slightly different set of failures but the test suite now covers the more up-to-date RFC 8259 which explains some differences. |
I tested Yojson on the test cases of https://github.com/nst/JSONTestSuite:
The problems are:
Yojson.Safe.from_string "x"
) raise a "Failure "lexing: empty token" exception instead of aJson_error
.NaN
andInfinity
, duplicate keys, comments, unquoted keys and unquoted control characters, tabs or newlines are not permitted according to RFC 7159. I don't think it's a problem to support some extensions to the specification, as long asto_string
always returns valid json. In that case, onlyNaN
andInfinity
and duplicate keys are problematic.The text was updated successfully, but these errors were encountered: