Description
Is your change request related to a problem? Please describe.
In Haskell's Aeson library, the default contentsFieldName
is "contents"
:
https://hackage.haskell.org/package/aeson-2.2.1.0/docs/Data-Aeson.html#v:defaultTaggedObject
In argonaut-codecs
, it appears the default is "value"
:
Examples:
https://github.com/coot/purescript-argonaut-aeson-generic depends on argonaut-codecs
and attempts to provide compatibility between PureScript's Argonaut and Haskell's Aeson. It uses "contents"
. For most data types, it works great. However, it cannot decode/encode Either
to be compatible with Haskell's Aeson.
I have provided an example in this issue: coot/purescript-argonaut-aeson-generic#22
I have attempted to fix this on the Haskell side by overriding the instances to use "value"
, but haven't managed to make this work: https://github.com/peterbecich/purescript-bridge/blob/55e265b0d44c001357cd3aef3ac4a894128df12f/example/src/Types.hs#L96
Describe the solution you'd like
My request is to change "value"
to "contents"
here:
and in the encoder
I have tested this: eskimor/purescript-bridge@55e265b This change fixes argonaut-aeson-generic
. Either
is encoded and decoded successfully.
Additional context
I am attempting to update Purescript Bridge and encountered this issue: eskimor/purescript-bridge#89
Thank you