Using JsonSanitizer for Java Objects

576 views
Skip to first unread message

Vijyendra Mishra

unread,
Jul 20, 2018, 5:22:39 PM7/20/18
to json-sanitizer-support
Hi, 

We need to sanitize a Json which is received as Java Object as shown in the below example

@Path("/agent”)
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response addAgent(Agent agent) throws Exception {}

We used JsonSanitizer for the purpose. However, JsonSanitizer accepts only String, so I had to convert my agent object to Json String, sanitize it and then convert back to agent object.

Is there an equivalent API which can sanitize Java Object directly without requiring the intermediate String conversion or any better approach than the one we took



Have asked the same query on stackOverflow

https://stackoverflow.com/questions/51402135/using-jsonsanitizer-for-java-objects


Reply all
Reply to author
Forward
0 new messages