-
Notifications
You must be signed in to change notification settings - Fork 49
add support for custom FromJSON/ToJSON instances #24
Copy link
Copy link
Open
Labels
Description
From README.md:
For compatible JSON representations you should be using aeson's generic encoding/decoding with default options and encodeJson and decodeJson from "Data.Argonaut.Generic.Aeson" in purescript-argonaut-generic-codecs.
It would be great to be able to support custom instances of FromJSON/ToJSON.
I'd like to be able to have a model like this:
data Book = Book { title :: String, pages: Int }
with lenses
book ^. bookTitle
book ^. bookPages
and with json
{ "title": "Test", "pages": 50 }
instead of the ugly
{ "_bookTitle": "Test", "_bookPages": 50 }
Reactions are currently unavailable