-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5.js
More file actions
33 lines (31 loc) · 912 Bytes
/
5.js
File metadata and controls
33 lines (31 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# GET https://swapi.dev/api/people/1
var data = JSON.parse(responseBody);
var schema = {
"type": "object",
//specify requires properties
"required": ["name","homeworld","films","species","vehicles","starships"],
//describe the properties
"properties":{
"name": {"type":"string"},
"homeworld": {"type":"string"},
"films": {
"type":"array",
"items":{"type":"string"}
},
"species": {
"type":"array",
"items":{"type":"string"}
},
"vehicles": {
"type":"array",
"items":{"type":"string"}
},
"starships": {
"type":"array",
"items":{"type":"string"}
},
}
};
pm.test('Body is correct.', function() {
pm.expect(tv4.validate(data, schema)).to.be.true;
});