bos/aeson — pull request #231 by tolysz (2014-12-08 17:56:43+00:00)
Title: Add possiblity to specify default values for for record fields:

Say we want to derive:

data GGResult = GGResult
{ _ggrtPartialMatch :: Bool
} deriving (Show, Typeable)

deriveJSON
defaultOptions
{ fieldLabelModifier = fromCamel 5
, fieldsWithDefaults = [ ("partial_match", [| False |]) ]
}
''GGResult

Now whenever parser was expecting field `"partial_match"` inside JSON file but it is not there, the parser will not fail but return a value `False`.