serde-ml / serde

Serialization framework for OCaml
MIT License
174 stars 11 forks source link

Serde failing to parse list with one object #37

Open maxRN opened 4 hours ago

maxRN commented 4 hours ago

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

linear[bot] commented 4 hours ago

RIOT-35 Serde failing to parse list with one object