-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathendpoints.yaml
50 lines (50 loc) · 1.49 KB
/
endpoints.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
50
# A GET method that returns a list of employees.
- method: GET
path: test/employees
status_code: 200
content: >
[
{ "first_name": "Peter", "last_name": "Venkman" },
{ "first_name": "Ray", "last_name": "Stantz" },
{ "first_name": "Egon", "last_name": "Spengler" }
]
# A GET method that returns an employee.
# Take note of the two %functions%- the employee's first name, last name and age will be random at every response.
- method: GET
path: test/employee/2
status_code: 200
content: >
{
"first_name": "%random_first_name(female)%",
"last_name": "%random_last_name()%",
"age": %random_int(20, 50)%
}
# A POST method that returns a 500. Great for testing error pages.
- method: POST
path: test/employee
media_type: text
status_code: 500
content: An unexpected error occurred while creating the employee.
# A PUT method that returns a 201. Does not return a body- content is optional.
- method: PUT
path: test/employee/3
status_code: 201
# A GET method that returns an HTML page.
- method: GET
path: test/help
status_code: 200
media_type: text/html
content: |-
<!DOCTYPE html>
<html>
<body>
<h1>I've quit better jobs than this.</h1>
<p>Ghostbusters, whaddya want.</p>
</body>
</html>
# The same method as above, but the content is referenced from another file. Path is relative to project root.
- method: GET
path: test/help2
status_code: 200
media_type: text/html
content_path: assets/help.html