Skip to content

Instantly share code, notes, and snippets.

@lSelectral
Last active August 8, 2022 22:32
Show Gist options
  • Save lSelectral/505e66b2859d64de2728db1c6fa04c9b to your computer and use it in GitHub Desktop.
Save lSelectral/505e66b2859d64de2728db1c6fa04c9b to your computer and use it in GitHub Desktop.
JSON Response Schema validation in Postman Test
const expectedResponseSchema = {
"type": "object",
"properties": {
"accessToken": {
"type": "string"
},
"refreshToken": {
"type": "string"
}
},
"required": [
"accessToken",
"refreshToken"
]
}
pm.test('Should send both ACCESS and REFRESH TOKEN', () => {
pm.response.to.have.jsonSchema(expectedResponseSchema)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment