I have a question regarding a web application that I am creating, where I have a REST service receiving a json string.
The Json line looks something like this:
{ "string" : "value", "string" : "value", "object" : { "string" : "value", "string" : "value", .... } }
I use resteasy to parse a json string that uses the jackson below it. I have an annotated jaxb class and I want to fully parse the "object" in a String variable. The reason I want to do this is the ability to parse json later using the correct parser (this depends on the application that sends the request, so it cannot be known in advance).
My annotated jaxb class is as follows:
@XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class Test{ @XmlElement(type = String.class) private String object;
When I make the remaining call and let Jenson parse this code, I get
Can not deserialize instance of java.lang.String out of START_OBJECT token
error. So actually I am trying to parse a piece of json string, which is a json object, into a String. I can not find someone with a similar problem.
Thanks in advance for any response.
source share