Hi I have the following classes:
public class MyRequest {
}
and
public class MyResponse {
}
and
public class Request<T> {
private String code;
private T request;
public setCode(String code) {
this.code = codel
}
public setRequest(T request) {
this.request = request
}
}
and following service request method:
public MyResponse getMyResponse(Request<MyRequest> myRequest) {
//process
try {
ObjectMapper mapper = new ObjectMapper();
String jsonInString = mapper.writeValueAsString(myRequest);
System.out.println(jsonInString);
} catch(Exception exp) {}
}
and following Json request is sending from JavaScript;
{
"code":"TESTCODE",
"request":null
}
After I send the request I an getting an Invalid Json error. Can anyone tell me what is wrong with my request Json or something else is wrong..?