Hello:
I'm using CXF 2.7.8
I've created a REST service . Format for POST messages is JSON
Sometimes , the service receives null values
{ .... , ·"field": null , .....}
I want to develop a JAXRS filter to remove this fields.
So, I need to modify message . I would like to know if :
is there any JAXRS template to extract JSON fields and remove them dynamically ?
other choice?
something as Transformation Feature ?
Example Filter :
@Override
public Response handleRequest(Message message, ClassResourceInfo resourceClass)
{
@SuppressWarnings("unchecked")
MetadataMap<String, String> map = (MetadataMap<String, String>)
message.get("jaxrs.template.???????");
if(null != map)
{
for (Map.Entry<String, List<String>> entry: map.entrySet())
{
System.out.println("key:" + entry.getKey() + "- value:" +
entry.getValue());
}
}
return null;
}
Regards