I'm using a JAXB adapter... JAXBDateAdapter
that formats my dates in a standard format for the JSON-consuming clients. I have a class User
that has a createdOn
field and it's annotated with XmlJavaTypeAdapter(JAXBDateAdapter.class)
When I return any User object from my resources, everything is fine. The adapter is hit and the dates are formatted. However, I have another call that returns a map of users
@GET
Map<String, List<User>> getUsers() { return ... }
I get back my json as
{"users" : [{ user in here }, { user in here } ]}
In this case my adapter never gets hit and the date comes back in a different form. How can I make it so that this also hits my adapter to format the dates properly?