We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Serde fails to parse this JSON object correctly:
{ "x": [ { "name": "max" } ] }
with the following type definitions:
type a = { name : string } [@@deriving deserialize, serialize,] type t = { x : a list } [@@deriving deserialize, serialize,]
error message:
Fatal error: exception Yojson__Common.Json_error("Line 6, bytes 5-12:\nExpected ',' but found '\n ]\n}\n'")
I have created a reproduction repo here: https://github.com/maxrn/serde_list_repro
The text was updated successfully, but these errors were encountered:
RIOT-35 Serde failing to parse list with one object
Sorry, something went wrong.
Did some more investigating and it seems to be related to white space. Here are two examples that don't work
let does_not_work = {| { "records": [ { "hello": "some str" } ] } |};; (* ^ the problem *) let does_not_work2 = {| { "records": [ { "hello": "some str" } , { "hello": "some other str" }] } |};; (* ^ the problematic whitespace *)
whereas these two strings parse fine:
let this_works = {| { "records": [ { "hello": "some str" }] } |};; let this_works2 = {| { "records": [ { "hello": "some str" }, { "hello": "some other str" }] } |};;
Note the additional whitespace between } ] and } , in the non-working examples.
} ]
} ,
Successfully merging a pull request may close this issue.
Serde fails to parse this JSON object correctly:
with the following type definitions:
error message:
Fatal error: exception Yojson__Common.Json_error("Line 6, bytes 5-12:\nExpected ',' but found '\n ]\n}\n'")
I have created a reproduction repo here: https://github.com/maxrn/serde_list_repro
The text was updated successfully, but these errors were encountered: