I am new to Playwright. I am writing API tests in TypeScript where my API response is like below:
{
"id" : "abc123",
"appCode" : "09000007",
"applicationReference" : "ABCDEF",
"datetimeSubmitted" : "2023-03-09T17:56:28.912876Z",
"firstName" : "ABC",
"surname" : "DEF",
"lastAddress" : {
"street" : "9779 Pat Loaf",
"property": "2"
}
}
How do I validate the JSONn schema in the response JSON using TypeScript in Playwright?
For example, I want to test if the response JSON contains:
id, appCode, applicationReference, datetimeSubmitted, firstname, surname, lastAddress.street, lastAddress.property
Is there any way to achieve such type of test in Playwright or any 3rd party plugin?
Any help is much appreciated.