I tried it in Postman first and happend to know its not working, below are the details.
Kindly let me knwo what could be mistake.
URL :- http://localhost:8080/student/
Request :- Post
Body :-
{
"firstName": "John",
"lastName": "Johny",
"email": "john12@gmail.com",
"programme": "Financial Analysis",
"courses": {
"name":"java",
"score":"32"
}
}
Error ecountered:-
{
"timestamp": 1627556131036,
"status": 400,
"error": "Bad Request",
"exception": "org.springframework.http.converter.HttpMessageNotReadableException",
"message": "Could not read document: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: java.io.PushbackInputStream@720140d3; line: 6, column: 20] (through reference chain: com.tej.entity.Student[\"courses\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: java.io.PushbackInputStream@720140d3; line: 6, column: 20] (through reference chain: com.tej.entity.Student[\"courses\"])",
"path": "/student/"
}