Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom property names for mapping and json #77

Closed
chrislovecnm opened this issue Aug 27, 2014 · 4 comments
Closed

Support for custom property names for mapping and json #77

chrislovecnm opened this issue Aug 27, 2014 · 4 comments
Labels

Comments

@chrislovecnm
Copy link

Hi

I am excited to see you added json serialization, because I am guessing that it is going to be faster much faster than components that use reflection or annotations. One component that is missing is the capability to set custom json field names.

Jackson allows the setting of field names via annotations such as:

@JsonProperty("name")

Is it possible to have the same type of support for both json and map instantiation of properties?

@jodastephen
Copy link
Member

To date, Joda-Beans serialization has been seen as a mechanism for transporting beans across the network without customization - the bean is the schema and defines the field names. Basic support has been added for reading old data, handling class, enum and field renames.

I'm not completely averse to adding a @PropertySerialization annotation that allows customization of the output, but it does make the system more complex. The real question is why does the serialized name need to be different?

@chrislovecnm
Copy link
Author

The issue main issue with json are with like data-value

Because of that I cannot serialize from json to joda bean

@jodastephen
Copy link
Member

I suppose that this requirement could be handled with a field name strategy, ie. convert lowerCamelCase to dash-separated (lower-camel-case).

Just so you are aware, my biggest problem with this is not the specific requirement (which is manageable), but the potential for other requirements to grow that turn Joda-Beans into a Jackson-like beast which allows any format of XML/JSON to be generated (ie a mapping tool). The serialization aspect of Joda-Beans was originally designed for serialization, where the format of the data is less important.

I do expect to make further enhancements to the serialization part, so I'll see what I can do at that point.

@chrislovecnm
Copy link
Author

Been open too long ... closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants