I am unable to creating a deriving list type when deserializing data
The code:
type user = {
id: int;
name: string;
some_bool: bool;
pet_name: string option;
some_int64: int64;
some_int32: int32;
some_float: float;
pets: string list;
pets_array: string array;
}
[@@deriving deserialize]
type users = user list [@@deriving deserialize]
The error message.
File "serde-postgres/test/test_serde.ml", line 33, characters 0-47:
33 | type users = user list [@@deriving deserialize]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This expression has type string
This is not a function; it cannot be applied.
This is the same when I am using an array
File "serde-postgres/test/test_serde.ml", line 33, characters 0-48:
33 | type users = user array [@@deriving deserialize]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This expression has type string
This is not a function; it cannot be applied.
I added reproducing step, let me know if it don't work.
I am going on vacation tomorrow until Sunday so I am not able to look into this myself until next week
I am unable to creating a deriving list type when deserializing data
The code:
The error message.
This is the same when I am using an array
Source code: https://github.com/dbcaml/dbcaml/blob/2e2fab3ea4b8d9b4bd6d7108ea6548f1fce51d4f/serde-postgres/test/test_serde.ml#L20-L33
Reproducing
The simplest way to reproduce is to clone gbcaml:
and checkout to either branch
v2
or sha2e2fab3ea4b8d9b4bd6d7108ea6548f1fce51d4f
.You should be able to do
and get all the packages needed.
run the test with:
dune runtest