How to assert on a property

Below is the json response, I want to make sure ā€œstatusā€ property is present. I donā€™t want to test for the value of the status i.e. 422

I tried with the following, but no luck.
pm.expect(responseInJson).to.have.property(ā€˜errors[0].extensions.data.statusā€™);

Blockquote

{

"errors": [

    {

        "message": "UnprocessableEntityError",

        "path": [

            "login"

        ],

        "extensions": {

            "code": "UNPROCESSABLE_ENTITY_ERROR",

            "name": "Unprocessable Entity",

            "data": {

                "errorCode": "",

                "status": 422,

                "friendlyMessage": "Could not register at this time.  Please try again later"

            }

        }

    }

],

"data": null

}

Update:
I was able to assert using the below code, but would like to know what is the difference between the 2?

//This one works
pm.response.to.have.jsonBody(ā€œdata.loginPowerPassCard.accessTokenā€);

//This one doesnt
pm.expect(responseInJson).to.have.property(ā€œdata.loginPowerPassCard.accessTokenā€);

.to.have.property('errors[0].extensions.data.status'); probably does not work because that does not count as a property. You can just paste a path to a property.

.to.have.property('errors'); would work, since errors is a property of the root object.

.to.have.jsonBody() may work, since you can provide a parameter with a path. So this will test the existence of the path within the response body.