BlackEdder / painlessjson

D library for converting any custom types to and from JSON the painless way.
Boost Software License 1.0
24 stars 3 forks source link

Added support for SerializationName/SerlizeIgnore/Property annotations. #7

Closed Zalastax closed 9 years ago

Zalastax commented 9 years ago

@SerializedName("to","from") x; @SerializedToName("toAndFrom") y; @SerializedToName("to") @SerializedFromName("from") z; @SerializedToName("to") w; Should all work.

Please run dfmt on painlessjson. I tried but it wanted to modify the whole file for me.

Zalastax commented 9 years ago

Added support for @property.

BlackEdder commented 9 years ago

Nice work. Will look at it over the weekend.

When you say:

@SerializedToName("toAndFrom") y;

Did you mean:

 @SerializedName("toAndFrom") y;

About dfmt. Think that at the moment it does not support in place fixing (which is weird because dfix from the same author does exactly that). So the only solution is to run it, pipe it to a separate file and then replace the original file. I'd be happy to do that after merging.

Zalastax commented 9 years ago

Yeah I meant:

@SerializedName("toAndFrom") y;
Zalastax commented 9 years ago

I'm not sure if the serializationFromName and serializationToName functions should be in the annotations module but I think they fitted best there. Maybe a new module instead but I don't want module bloat.

BlackEdder commented 9 years ago

Thanks, looks great.