WIP
[demos/example-siren] / consumer / pacts / Siren Order Provider-Siren Order Service.json
1 {
2   "consumer": {
3     "name": "Siren Order Provider"
4   },
5   "interactions": [
6     {
7       "description": "get all orders",
8       "request": {
9         "method": "GET",
10         "path": "/orders"
11       },
12       "response": {
13         "body": {
14           "class": [
15             "entity"
16           ],
17           "entities": [
18             {
19               "actions": [
20                 {
21                   "href": "http://localhost:8080/orders/1234",
22                   "method": "PUT",
23                   "name": "update"
24                 },
25                 {
26                   "href": "http://localhost:8080/orders/1234",
27                   "method": "DELETE",
28                   "name": "delete"
29                 }
30               ],
31               "class": [
32                 "entity"
33               ],
34               "links": [
35                 {
36                   "href": "http://localhost:8080/orders/1234",
37                   "rel": [
38                     "self"
39                   ]
40                 }
41               ],
42               "properties": {
43                 "id": 1234
44               },
45               "rel": [
46                 "item"
47               ]
48             }
49           ],
50           "links": [
51             {
52               "href": "http://localhost:8080/orders",
53               "rel": [
54                 "self"
55               ]
56             }
57           ]
58         },
59         "generators": {
60           "body": {
61             "$.entities[*].links[0].href": {
62               "example": "http://localhost:8080/orders/1234",
63               "regex": ".*(\\/orders\\/\\d+)$",
64               "type": "MockServerURL"
65             },
66             "$.links[0].href": {
67               "example": "http://localhost:8080/orders",
68               "regex": ".*(\\/orders)$",
69               "type": "MockServerURL"
70             }
71           }
72         },
73         "headers": {
74           "Content-Type": "application/vnd.siren+json"
75         },
76         "matchingRules": {
77           "body": {
78             "$.entities": {
79               "combine": "AND",
80               "matchers": [
81                 {
82                   "match": "type"
83                 }
84               ]
85             },
86             "$.entities[*].actions": {
87               "combine": "AND",
88               "matchers": [
89                 {
90                   "match": "arrayContains",
91                   "variants": [
92                     {
93                       "generators": {
94                         "$.href": {
95                           "example": "http://localhost:8080/orders/1234",
96                           "regex": ".*(\\/orders\\/\\d+)$",
97                           "type": "MockServerURL"
98                         }
99                       },
100                       "index": 0,
101                       "rules": {
102                         "$.href": {
103                           "combine": "AND",
104                           "matchers": [
105                             {
106                               "match": "regex",
107                               "regex": ".*(\\/orders\\/\\d+)$"
108                             }
109                           ]
110                         }
111                       }
112                     },
113                     {
114                       "generators": {
115                         "$.href": {
116                           "example": "http://localhost:8080/orders/1234",
117                           "regex": ".*(\\/orders\\/\\d+)$",
118                           "type": "MockServerURL"
119                         }
120                       },
121                       "index": 1,
122                       "rules": {
123                         "$.href": {
124                           "combine": "AND",
125                           "matchers": [
126                             {
127                               "match": "regex",
128                               "regex": ".*(\\/orders\\/\\d+)$"
129                             }
130                           ]
131                         }
132                       }
133                     }
134                   ]
135                 }
136               ]
137             },
138             "$.entities[*].links[0].href": {
139               "combine": "AND",
140               "matchers": [
141                 {
142                   "match": "regex",
143                   "regex": ".*(\\/orders\\/\\d+)$"
144                 }
145               ]
146             },
147             "$.entities[*].properties.id": {
148               "combine": "AND",
149               "matchers": [
150                 {
151                   "match": "integer"
152                 }
153               ]
154             },
155             "$.links[0].href": {
156               "combine": "AND",
157               "matchers": [
158                 {
159                   "match": "regex",
160                   "regex": ".*(\\/orders)$"
161                 }
162               ]
163             }
164           },
165           "header": {}
166         },
167         "status": 200
168       }
169     }
170 }