I am trying to find how @RequestBody
is work
suppose i have post request with input json like this
{
"firstName" : "abcdf",
"email" : "abc@xyz.com",
"phoneNumber" :"0000000000"
}
but my java class have variable like
class Student{
private String fullName;
private String emailAddress;
private int mobileNumber;
// getter and setter here
}
my Rest End point is like.
@RequestMapping(value = "/saveStudentInfo", method = RequestMethod.Post)
public setStudentInfo(@requestBody Student student){
return studentService.save(student);
}
So What i do if my json veriable and java class variable is different is there any @annotation is there that i can use in Pojo class so it can map with different veriable name