Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
jsonLower :: forall m. m ~ Either [Text] => Value -> m Value Source #
Turn all keys in a JSON object to lowercase recursively. This is applied to the aeson
Value
to be parsed; parseOptions
is applied to the keys passed to (.:)
etc. If an
object contains two fields that only differ in casing, Left
is returned with a list of
the offending fields.
NB: be careful to not mix 'Data.Text.{toLower,toCaseFold}', toLower
, and
foldCase
. They're not all the same thing!
https://github.com/basvandijk/case-insensitive/issues/31
(FUTUREWORK: The "recursively" part is a bit of a waste and could be dropped, but we would have to spend more effort in making sure it is always called manually in nested parsers.)