Merge: serialization: new annotation to rename an attribute in the serialization...
authorJean Privat <jean@pryen.org>
Fri, 18 Mar 2016 20:14:49 +0000 (16:14 -0400)
committerJean Privat <jean@pryen.org>
Fri, 18 Mar 2016 20:14:49 +0000 (16:14 -0400)
By default, an attribute is identified in the serialization format by its Nit name. The `serialize_as` attribute changes this behavior and sets the name of an attribute in the serialization format. It works with both the JSON and the binary implementations.

This annotation can be useful to change the name of an attribute to what is expected by a remote service. Or to use identifiers in the serialization format that are reserved keywords in Nit (like `class` and `type`).

Pull-Request: #1985
Reviewed-by: Jean Privat <jean@pryen.org>


Trivial merge