Second example of Json used in the module "Different approaches for building complex json" is not working | Rest Assured Forum
B
Bipin Thakare Posted on 29/07/2021

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/"
}