by wraithm112 · 9y ago · 0 comments
data Person = Person
{ personFirstName :: Text
, personLastName :: Text
} deriving (Generic)
instance ToJSON Person where
toJSON = genericToJSON $ aesonPrefix snakeCase
instance FromJSON Person where
parseJSON = genericParseJSON $ aesonPrefix snakeCase
Which produces messages like: {
"first_name": "John",
"last_name": "Doe"
}No comments yet.