Open object opened 3 years ago
Out of curiosity: is "comparer" element used in some scenarios? Looks like Thoth.Json.Giraffe/Thoth.Json.Net manage fine without it.
Hello @object sorry for the delay
This is bug in Thoth.Json (Fable version) which kind of "stringify" the whole instance of a map.
I suppose you DUs looks similar to Verifier of Map<.., ...>
If you look at the instance of your map in memory you will an object with comparer
and tree
property.
As a workaround you can use manual decoder for now.
I reproduced this using versions of Thoth.Json 4.0 and Thoth.Json.Net 4.1.
This is an example of a JSON generated using Decode.Auto from a Fable app (Thoth.Json):
"Customer":["Verified",{"comparer":{},"tree":["MapOne","CustomerIdentity",{"Id":1,"PhoneNumber":"12345678"}]}]
Thoth.Json.Net fails to decode this string because it doesn't expect comparer node. If I serialize the same data using Thoth.Json.Net, it works fine:
"Customer":["Verified",{"CustomerIdentity":{"Id":1,"PhoneNumber":"12345678"}}]