Last active
August 8, 2022 22:32
-
-
Save lSelectral/505e66b2859d64de2728db1c6fa04c9b to your computer and use it in GitHub Desktop.
JSON Response Schema validation in Postman Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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