generated from sv-tools/go-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_config.yaml
46 lines (46 loc) · 1.19 KB
/
example_config.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
request_id_header: "X-Request-ID" # to be logged if present in the request headers
routes:
- pattern: GET /users # see https://go.dev/blog/routing-enhancements for more information about patterns
responses:
- code: 200 # first 3 responses: 200 OK
body: |
[
{
"id": 1,
"name": "John"
},
{
"id": 2,
"name": "Jane"
}
]
is_json: true
repeat: 3
- code: 500 # 4th response: 500 Internal Server Error
repeat: 1
body: "something is broken"
- code: 200 # all other responses: 200 OK
body: |
[
{
"id": 1,
"name": "John"
},
{
"id": 2,
"name": "Jane"
}
]
is_json: true
- pattern: GET /users/{id}
responses:
- code: 200
body: | # supports Go templates: https://pkg.go.dev/text/template
{
"id": "{{.PathValue "id"}}",
"name": "John"
}
is_json: true
repeat: 1
- code: 404
body: user "{{.PathValue "id"}}" not found