aboutsummaryrefslogtreecommitdiff
path: root/pacts/forumsstore-forumapiserver.json
blob: 26a2810b2b271d921d3f29c5ecdde63d6831f808 (plain)
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
{
  "consumer": {
    "name": "ForumsStore"
  },
  "provider": {
    "name": "ForumAPIServer"
  },
  "interactions": [
    {
      "description": "a request to list the forums",
      "request": {
        "method": "POST",
        "path": "/graphql",
        "headers": {
          "content-type": "application/json"
        },
        "body": {
          "operationName": "GetForums",
          "query": "query GetForums {\n            forums {\n              id\n              glyph\n              label\n              position\n              __typename\n            }\n          }",
          "variables": {
          }
        },
        "matchingRules": {
          "$.body.query": {
            "match": "regex",
            "regex": "query\\s*GetForums\\s*\\{\\s*forums\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*__typename\\s*\\}\\s*\\}"
          }
        }
      },
      "response": {
        "status": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8"
        },
        "body": {
          "data": {
            "forums": [
              {
                "id": "butter",
                "glyph": "⌘",
                "label": "test_forums.butter",
                "position": 1
              }
            ]
          }
        },
        "matchingRules": {
          "$.body.data.forums": {
            "min": 1
          },
          "$.body.data.forums[*].*": {
            "match": "type"
          },
          "$.body.data.forums[*].id": {
            "match": "type"
          },
          "$.body.data.forums[*].glyph": {
            "match": "type"
          },
          "$.body.data.forums[*].label": {
            "match": "type"
          },
          "$.body.data.forums[*].position": {
            "match": "type"
          }
        }
      }
    }
  ],
  "metadata": {
    "pactSpecification": {
      "version": "2.0.0"
    }
  }
}