-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrud.yaml
49 lines (46 loc) · 1.06 KB
/
crud.yaml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
create_a_thing:
name: "Create a thing"
url: "{{ .host }}/things/"
method: "POST"
body: |
{
"hello": "world",
"works": false
}
headers:
Authorization: ["Bearer sample_bearer_token"]
assert:
response:
code: 200
body: '{"id": 0}'
headers:
Content-Type: ["application/json"]
read_a_thing:
name: "Read a thing"
url: "{{ .host }}/things/${ json .create_a_thing `id` }"
method: "GET"
headers:
Authorization: ["Bearer sample_bearer_token"]
assert:
response:
code: 200
jsonschema:
ref: "examples/thing.json"
delete_a_thing:
name: "Delete a thing"
url: "{{ .host }}/things/${ json .create_a_thing `id` }"
method: "DELETE"
headers:
Authorization: ["Bearer sample_bearer_token"]
assert:
response:
code: 201
read_a_missing_thing:
name: "Read a missing thing"
url: "{{ .host }}/things/${ json .create_a_thing `id` }"
method: "GET"
headers:
Authorization: ["Bearer sample_bearer_token"]
assert:
response:
code: 404