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

Cleanup: add additional annotations for often used conversions #880

Closed
nbartels opened this issue Apr 23, 2018 · 0 comments
Closed

Cleanup: add additional annotations for often used conversions #880

nbartels opened this issue Apr 23, 2018 · 0 comments
Assignees
Milestone

Comments

@nbartels
Copy link
Contributor

nbartels commented Apr 23, 2018

At the moment we use a JsonMappingCompleted method to do some stuff after the mapping. Often used is the date conversion, because the mapper don't knows about this in the first place.
We let the mapper write the transferred date as String in a raw field and let the post-mapping method convert this String into the java Date object afterwards.

This results in many code duplications and lot of raw fields, that are only added to the object for this very special use case. I suggest to add a Date conversion from JSON to Date. The other way around is already implemented and we can convert a Date to JSON.

With this change we stay backwards compatible, because we have the possibility to save the provided string containing a date as String and to a more complex conversion afterwards. But for the common case we don't need two fields and no post mapping methods 😄

nbartels added a commit that referenced this issue Apr 24, 2018
@nbartels nbartels added this to the 2.5.0 milestone Apr 26, 2018
@nbartels nbartels self-assigned this Apr 26, 2018
@nbartels nbartels removed the ready label Apr 26, 2018
@restfb restfb locked and limited conversation to collaborators Jul 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant