Commit 3dce69e0 authored by Siebers, Michael's avatar Siebers, Michael
Browse files

saveguard storing of error schema

parent 3e22d30d
......@@ -39,6 +39,7 @@
"script": {
"exec": [
"if(! pm.collectionVariables.get(\"response-schema:error\")) {",
" var code_ok = false;",
" const schema_url = \"http://\" + pm.environment.get(\"SERVER\") + pm.environment.get(\"SCHEMA_PATH\") ",
" + \"/response-error-schema.json\";",
" pm.sendRequest(schema_url, function(err, response){",
......@@ -46,6 +47,7 @@
" pm.expect(err).to.not.be.ok;",
" console.log(response);",
" pm.expect(response.code).to.eql(200);",
" code_ok = true;",
" });",
"",
"",
......@@ -53,7 +55,8 @@
" const jsonData = response.json();",
" pm.expect(jsonData).is.an(\"object\");",
"",
" pm.collectionVariables.set(\"response-schema:error\", JSON.stringify(jsonData));",
" if(code_ok)",
" pm.collectionVariables.set(\"response-schema:error\", JSON.stringify(jsonData));",
" });",
" });",
"}",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment