bos/aeson — Issue #53: Generic _ fieds handling
Author: akaspin
Created: 2011-12-17 23:25:13+00:00
State: open

Example:

data Solid = Solid {
_id :: String,
solidStr :: String
} deriving (Show, Eq, Data, Typeable)

solidJson = "{\"_id\":\"a\",\"solidStr\":\"s\"}"

And now big headahe:

decode solidJson :: Maybe Solid

Expect:

Just (Solid {_id = "a", solidStr="s"})

But got:

Nothing

This happens only if `_-fields` in JSON. But I use `aeson` for CouchDB. And CouchDB sends "system" fields `_id` and `_rev`.