[Solved] When post request is done in postman it passes all the values as NULL


It looks like the JSON that you’re sending as your POST payload is not a representation of a Student object. Instead, it’s a representation of an object that contains two members, a Student object named student, and a String named id.

{
  "student":{ //<-- This is a Student object
    "firstname": "jay",
    "lastname": "patel",
    "studentId": "2",
    "email": "[email protected]"
  },
  "id":"1" //<-- This is a String
} 

If that payload were deserialized into a Java class, it would look like this:

public class SomeObject {
    public Student student;
    public String id;
}

In short, your REST endpoint is expecting a Student object, but that’s not what you’re providing it with, and it can’t deserialize this “SomeObject” representation into an instance of Student.

Try changing your payload to be the representation of just the Student object that the endpoint is expecting:

{
  "firstname": "jay",
  "lastname": "patel",
  "studentId": "2",
  "email": "[email protected]"
}

solved When post request is done in postman it passes all the values as NULL