I want to add a payload schema to an environment variable so that I can validate the response payload against the schema.
I have my environment variable defined as follows:
responseSchema:
{ "properties":
"firstname":
{"type":"string" },
"lastname":
{"type":"string"},
"phonenumber":
{"type":"integer","format":"int64"}
},
"required":["firstname", "lastname", "phonenumber"]}
However, I can not access this environment variable within my Postman Test code. I've tried accessing it by:
environment.responseSchema
However, this returns null. How can I access the environment variable that I've created using postman. The way I have implemented this is consistent with http://blog.getpostman.com/2017/07/28/api-testing-tips-from-a-postman-professional/ TIP #4: JSON Schema validation