Module
Data.Codec.Argonaut.Migration
- Package
- purescript-codec-argonaut
- Repository
- garyb/purescript-codec-argonaut
#addDefaultField Source
addDefaultField :: String -> Json -> JsonCodec Json
When dealing with a JSON object that may be missing a field, this codec can be used to alter the JSON before parsing to ensure a default value is present instead.
#addDefaultOrUpdateField Source
addDefaultOrUpdateField :: String -> (Maybe Json -> Json) -> JsonCodec Json
When dealing with a JSON object that may be missing a field, this codec
can be used to alter the JSON before parsing to ensure a default value is
present instead. Similar to addDefaultField
, but allows existing values
to be modified also.