-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathsimple.yaml
More file actions
57 lines (57 loc) · 1.53 KB
/
simple.yaml
File metadata and controls
57 lines (57 loc) · 1.53 KB
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
51
52
53
54
55
56
57
#!api-testing-mock
# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-mock-schema.json
items:
- name: prList
request:
path: /api/v1/repos/{repo}/prs
response:
header:
server: mock
content-type: application/json
body: |
{
"count": 1,
"items": [{
"title": "fix: there is a bug on page {{ randEnum "one" "two" "three" "four" }}",
"number": {{randInt 100 199}},
"float": {{randFloat 0.0 1.0}},
"status": "{{randWeightEnum (weightObject 4 "open") (weightObject 1 "closed")}}",
"message": "{{.Response.Header.server}}",
"author": "{{env "USER"}}",
"created": "{{ now.Format "2006-01-02T15:04:05Z07:00" }}"
}],
"uptime": "{{uptime}}"
}
- name: base64
request:
path: /api/v1/base64
response:
body: aGVsbG8=
encoder: base64
- name: baidu
request:
path: /v1/baidu
response:
body: https://baidu.com
encoder: url
proxies:
- path: /api/v1/{part}
target: http://atest.localhost:8080
- path: /open-apis/bot/v2/hook/{token}
target: https://open.feishu.cn/
echo: true
requestAmend:
bodyPatch: |
[{
"op": "add",
"path": "/msg_type",
"value": "text"
}, {
"op": "add",
"path": "/content",
"value": {}
}, {
"op": "move",
"from": "/text",
"path": "/content/text"
}]