Skip to content

add support for custom FromJSON/ToJSON instances #24

@legrostdg

Description

@legrostdg

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 }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions