Comments by "" (@rakeshyadavvanamula5411) on "JSON Schema validation in Postman" video.
-
How to validate nested objects using the below response, I would like to validate ownerName {
"RakeshResponse": {
"statusCode": "200",
"statusMessage": "Success",
"txnId": 93384,
"propertyResponse": {
"customerId": "Rakesh123",
"propertyId": "10101042168",
"occupierName": "",
"ownerName": "MANISH SING",
"secondOwnerName": "",
"address": "1-19-77/3/302 mumbai",
"area": "Prasanth Nagar",
"status": "",
"contactDetails": "",
"propertyType": ""
}
}
}
1
-
I got it:
"RakeshResponse": {
"type": "object",
"properties": {
"statusCode": {
"type": "string"
},
"statusMessage": {
"type": "string"
},
"txnId": {
"type": "integer"
},
"propertyResponse": {
"type": "object",
"properties": {
"customerId": {
"type": "string"
},
"propertyId": {
"type": "string"
},
"occupierName": {
"type": "string"
},
"ownerName": {
"type": "string"
},
"secondOwnerName": {
"type": "string"
},
"address": {
"type": "string"
},
"area": {
"type": "string"
},
"status": {
"type": "string"
},
"contactDetails": {
"type": "string"
},
"propertyType": {
"type": "string"
}
},
"required": [
"customerId",
"propertyId",
"occupierName",
"ownerName",
"secondOwnerName",
"address",
"area",
"status",
"contactDetails",
"propertyType"
]
}
},
"required": [
"statusCode",
"statusMessage",
"txnId",
"propertyResponse"
]
}
},
"required": [
"RakeshResponse"
]
}
1