I am implementing a restfull service with Resteasy that will be consumed by a Extjs client, and i want to decorate the json object retrieved in the http response with some more attributes without using a wrapper class with additional attributes in the service method or overriding JacksonJsonProvider
Example:
raw object:
{
"id":"1",
"name":"Diego"
}
decorated object:
{
"success":"true",
"root":{
"id":"1",
"name":"Diego"
}
}
I found JAXB Decorators but i could not implement a decorator for json type.
I tried to replace the entity that will be serialized with a wrapper using Interceptors but it doesn't work if a replace the entity which is a Collection.
Any suggestions?