| 138 | |
| 139 | === {{{@JsonSerialize}}} |
| 140 | This annotation allows a custom hand-coded serializer to be used. The argument is a full.class.path of the class implementing Serializer. |
| 141 | |
| 142 | For example, {{{@JsonSerialize("test.DeserializerTest.ValueSerializer")}}} |
| 143 | |
| 144 | The Serializer requires one implemented method: |
| 145 | {{{ def serialize(self, obj:object)-> object }}} |
| 146 | |
| 147 | It takes the python object, and returns a json object (dict, list, etc) containing the serialized object. |
| 148 | |
| 149 | {{{@JsonSerialize}}} and {{{@JsonDeserialize}}} will usually come in pairs, as a custom serialization will need a custom deserialization. |
| 150 | |