Open yaitskov opened 1 year ago
| PostProcessBody (Text -> Value -> Value)
is no go. See toEncoding
, there is no intermediate Value
s.
About configurability: #933. The current swiss-knife approach is not maintainable.
there is no intermediate
Value
s.
I anticipated that it could be a alternative encoding branch - less efficient - this DC is an escape hatch first.
I was lucky and figured out that on PureScript side was easier to fix the issue, but in case of no power to change encoding format what are the options? An HTTP interceptor with Lua script on nginx rewriting JSON or bash+jq for files?
https://github.com/garyb/purescript-codec-argonaut/issues/59
Hi,
I just noticed a mismatch in enconding conventions between Argounaut (PureScript) and Aeson.
Argounaut always wraps content into sub object with "content" key, when sum type is serialized, mean while Aeson does that only for constructors without named slots! So I have to drop names in Haskell source code and define lenses manually!
There are some tickets about Sum type encoder and I think this one won't be the last. Sum encoder should be more configurable. I agree PureScript encoding might be less compact, but PureScript community is smaller.
I would add following data constructor to
SumEncoding
:Then original encoding logic for
TaggedObject
might be expressed like that:and Argonaut case: