Open toots opened 2 years ago
Test:
type foo = { bar : string; foo : (int [@default 123]); } [@@deriving yojson] let () = try ignore(foo_of_yojson (Yojson.Safe.from_string {|{"bar":"baz"}|})) with | Ppx_yojson_conv_lib.Yojson_conv.Of_yojson_error (exn, _) -> Printf.printf "Error: %s\n%!" (Printexc.to_string exn); exit 1
Result:
Error: Failure("test.ml.foo_of_yojson: the following record elements were undefined: foo")
Test:
Result: