-
Notifications
You must be signed in to change notification settings - Fork 117
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
Cached Optional
serializer does not apply annotations for POJO properties
#17
Comments
I believe all that's needed is |
Appears to affect 2.8 at least. Due to repo refactoring needs to be applied in 2 places, which is fine, I can handle the other one. |
Ok, found a simpler fix which I think is proper; different call to |
Optional
serializer does not apply annotations for POJO properties
Sounds good, thank you very much! |
Simple test case:
produces the output:
{"date1":"2017-03-10","date2":"2017-03-10"}
changing the order of the members to:
produces the output:
{"date2":"2017-03","date1":"2017-03"}
I have found that the issue lies in
OptionalSerializer.java
on theser = _findCachedSerializer(provider, value.getClass());
line. The first time a Date is encountered, a new serializer is constructed which observes the relevant annotation; however, every time a Date is encountered afterwards the cached serializer is used without any consideration regarding annotation differences.The text was updated successfully, but these errors were encountered: