DUB lacked a package for going between D objects and JSON.
painlessjson is a library just released on DUB looking to be the
easy solution for converting D data to and from JSON.
painlessjson uses templates and traits to generate code that
converts to and from std.json.
The goals of painlessjson are:
- Easy to use and set up
- Highly configurable with sensible defaults
- Keep the library code simple by not reinventing what others
provide for us
- Support as many D types as possible
Current features are:
- Convert to and from std.json, structs and classes with default
constructor, arrays, associative arrays, and any type
implementing _toJSON + _fromJSON.
- Includes @property functions
- Ignore a field using @SerializeIgnore
- Rename a field using @SerializedName("Name") or
This project gained momentum just recently so there are several
things to improve. We want input and help to make this as great
The features that are being designed right now are quite tricky
to get right so any help would be greatly appreciated.
The project is on github:
And on DUB: http://code.dlang.org/packages/painlessjson
Our current issues are:
- How do we support subclasses?
- How should constructors be handled? Don't forget alias this and
preferably find the best constructor to use without relying on