Details
-
Improvement
-
Status: Open
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
None
Description
When Date values are returned by org.hippoecm.hst.restapi.content.visitors.AbstractNodeVisitor#getValueRepresentation(Value), Strings are returned instead of Calendar objects. The benefit of returning Calendar instead is described by wko in the forum:
"I think org.hippoecm.hst.restapi.content.visitors.AbstractNodeVisitor#getValueRepresentation(Value) should have handled date property in a better way.
At the moment, the method simply converts JCR date property value to string and pushes the value to the response object.
If it pushes a Calendar object instead (which should be an obvious choice since JCR returns Calendar object anyway), the ObjectMapper of Jackson2 could have serialized it to epoch number by default, with an option to change it by spring bean configuration to something like ISO8601 string.
Anyway, as it's hard-coded to convert Calendar to string by default, it's almost impossible or too hard to change it at the moment.
I would rather fix the logic of AbstractNodeVisitor#getValueRepresentation(Value) to put Calendar object, and let Jackson2 handle it in serialization."
This may be a non backwards compatible change.