Module
Data.Argonaut.Generic.Decode
- Package
- purescript-argonaut-generic-codecs
- Repository
- eskimor/purescript-argonaut-generic-codecs
Flexible generic decoding. Use this for defining your own custom encodings or use "Data.Argonaut.Generic.Aeson" and "Data.Argonaut.Generic.Argonaut" for concrete codecs.
#genericUserDecodeJson' Source
genericUserDecodeJson' :: Options -> GenericSignature -> Json -> Either String GenericSpine
Generically decode json, using a supplied userEncoding, falling back to genericEncodeJson':
#genericDecodeJson' Source
genericDecodeJson' :: Options -> GenericSignature -> Json -> Either String GenericSpine
Decode Json
representation of a GenericSpine
.
Re-exports from Data.Argonaut.Generic.Options
#SumEncoding Source
data SumEncoding
Constructors
TaggedObject { contentsFieldName :: String, tagFieldName :: String, unpackRecords :: Boolean }
#Options Source
newtype Options
Constructors
Options { allNullaryToStringTag :: Boolean, constructorTagModifier :: String -> String, encodeSingleConstructors :: Boolean, fieldLabelModifier :: String -> String, flattenContentsArray :: Boolean, omitNothingFields :: Boolean, sumEncoding :: SumEncoding, userDecoding :: Options -> GenericSignature -> Json -> Maybe (Either String GenericSpine), userEncoding :: Options -> GenericSignature -> GenericSpine -> Maybe Json }
#dummyUserEncoding Source
dummyUserEncoding :: Options -> GenericSignature -> GenericSpine -> Maybe Json
Use this for userEncoding
if you don't want any special rules.
#dummyUserDecoding Source
dummyUserDecoding :: Options -> GenericSignature -> Json -> Maybe (Either String GenericSpine)
Use this for userDecodeing
if you don't want any special rules.