-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
example-pact.json
121 lines (121 loc) · 4.03 KB
/
example-pact.json
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
"provider": {
"name": "user-data-provider"
},
"consumer": {
"name": "user-data-cli"
},
"interactions": [
{
"description": "can get user data from user data provider",
"request": {
"method": "GET",
"path": "/user"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json; charset=UTF-8"
},
"body": {
"firstName": "string",
"lastName": "string",
"ids": {
"id": 100,
"uuid": "e2490de5-5bd3-43d5-b7c4-526e33f71304"
},
"age": 100
},
"matchingRules": {
"body": {
"$.firstName": {
"matchers": [
{
"match": "type"
}
],
"combine": "AND"
},
"$.lastName": {
"matchers": [
{
"match": "type"
}
],
"combine": "AND"
},
"$.age": {
"matchers": [
{
"match": "number"
}
],
"combine": "AND"
},
"$.ids.id": {
"matchers": [
{
"match": "integer"
}
],
"combine": "AND"
},
"$.ids.uuid": {
"matchers": [
{
"match": "regex",
"regex": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
}
],
"combine": "AND"
}
},
"header": {
"Content-Type": {
"matchers": [
{
"match": "regex",
"regex": "application/json;\\s?charset=(utf|UTF)-8"
}
],
"combine": "AND"
}
}
},
"generators": {
"body": {
"$.firstName": {
"type": "RandomString",
"size": 20
},
"$.lastName": {
"type": "RandomString",
"size": 20
},
"$.age": {
"type": "RandomInt",
"min": 0,
"max": 2147483647
},
"$.ids.id": {
"type": "RandomInt",
"min": 0,
"max": 2147483647
},
"$.ids.uuid": {
"type": "Uuid"
}
}
}
}
}
],
"metadata": {
"pactSpecification": {
"version": "3.0.0"
},
"pact-jvm": {
"version": "3.5.21"
}
}
}