Merge: Custom serializer
authorJean Privat <jean@pryen.org>
Tue, 16 May 2017 13:28:17 +0000 (09:28 -0400)
committerJean Privat <jean@pryen.org>
Tue, 16 May 2017 13:28:17 +0000 (09:28 -0400)
commitbe12401209a7cc1865a047b4da594f39afaadd1b
tree5d7e3b5b00280a56d452a919c66365809077a846
parentbf79ab51266d436c0ba596372af465b6150365cf
parent56a5cc2bb61a8a7e92ac230600e24f871f373f9b
Merge: Custom serializer

This is an old attempt to add the possibility to have a custom serializer. The idea is that a same set of objects can be serialized in different ways if different serializers are used.

Most of what is needed to do that is already present; the main contribution of this PR is the example that tries to propose a way to do that. The example focuses on 3 simples needs:

* inject a phantom attribute.
  when serializing, the custom serializer inject new attributes.
* hide a normally serialized attribute.
  when serializing, the custom serializer hides some specific attributes.
* replace a full business object.
  instead of serializing an attribute, the custom serializer use a different representation

Pull-Request: #2426
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>