@Chris perhaps I’m not using your script correctly because I tried it with the other fields and got the same thing.
Test Script:
const expectedSchema = {
"avatar": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"id": {
"type": "string"
},
"meta": {
"address": {
"type": "string"
},
"address_hash": {
"type": "string"
},
"agentId": {
"type": "string"
},
"agent_email": {
"type": "string"
},
"company": {
"type": "string"
},
"first_name": {
"type": "string"
},
"follow_email": {
"type": "string"
},
"last_name": {
"type": "string"
},
"listingCacheKey": {
"type": "string"
},
"listingId": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"realtor_group_id": {
"type": "string"
},
"relationship_id": {
"type": "string"
},
"source": {
"type": "string"
}
},
"name": {
"type": "string"
},
"notified": {
"type": "boolean"
},
"notifiedText": {
"type": "boolean"
},
"type": {
"type": "string"
},
"updatedAt": {
"type": "string"
},
"userId": {
"type": "string"
}
};
var actualSchema = JSON.parse(responseBody);
tests["Activities schema is valid"] = tv4.validate(actualSchema.data[0], expectedSchema)
let response = pm.response.json();
console.log("typeVar", response.data.type.type);
Response Body:
"data": [
{
"avatar": "initials",
"createdAt": "2019-03-13T16:03:26.625+00:00",
"id": "abc",
"meta": {
"address": "123 Fake Street, Orange CA 91745",
"address_hash": "abc",
"agentId": null,
"agent_email": "[email protected]",
"company": "ABC Inc",
"first_name": "Linda",
"follow_email": "[email protected]",
"last_name": "Kim",
"listingCacheKey": "[email protected]",
"listingId": "0000",
"name": "Linda Kim",
"phone": "555-270-3964",
"realtor_group_id": "abc",
"relationship_id": "abc",
"source": "abc"
},
"name": "abc",
"notified": false,
"notifiedText": true,
"type": "abc",
"updatedAt": "2019-03-13T17:01:01.075+00:00",
"userId": "abc"
}