{ "consumer": { "name": "Pact Broker Client" }, "provider": { "name": "PactFlow" }, "interactions": [ { "description": "a request for the index resource", "providerState": "the pb:publish-provider-contract relation exists in the index resource", "request": { "method": "GET", "path": "/", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pf:publish-provider-contract": { "href": "http://localhost:1235/HAL-REL-PLACEHOLDER-PF-PUBLISH-PROVIDER-CONTRACT-{provider}" } } }, "matchingRules": { "$.body._links.pf:publish-provider-contract.href": { "match": "regex", "regex": "http:\\/\\/.*{provider}" } } } }, { "description": "a request to publish a provider contract", "request": { "method": "post", "path": "/HAL-REL-PLACEHOLDER-PF-PUBLISH-PROVIDER-CONTRACT-Bar", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json,application/problem+json" }, "body": { "pacticipantVersionNumber": "1", "tags": [ "dev" ], "branch": "main", "buildUrl": "http://build", "contract": { "content": "LS0tCnNvbWU6IGNvbnRyYWN0Cg==", "contentType": "application/yaml", "specification": "oas", "selfVerificationResults": { "success": true, "content": "c29tZSByZXN1bHRz", "contentType": "text/plain", "format": "text", "verifier": "my custom tool", "verifierVersion": "1.0" } } } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "notices": [ { "text": "some notice", "type": "info" } ], "_embedded": { "version": { "number": "1" } }, "_links": { "pb:pacticipant-version-tags": [ { } ], "pb:branch-version": { } } }, "matchingRules": { "$.body.notices": { "min": 1 }, "$.body.notices[*].*": { "match": "type" } } } }, { "description": "a request to create a provider contract", "request": { "method": "put", "path": "/contracts/provider/Bar/version/1", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "content": "LS0tCnNvbWU6IGNvbnRyYWN0Cg==", "contractType": "oas", "contentType": "application/yaml", "verificationResults": { "success": true, "content": "c29tZSByZXN1bHRz", "contentType": "text/plain", "format": "text", "verifier": "my custom tool", "verifierVersion": "1.0" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" } } }, { "description": "a request to create a provider contract", "providerState": "there is a pf:ui href in the response", "request": { "method": "put", "path": "/contracts/provider/Bar/version/1", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "content": "LS0tCnNvbWU6IGNvbnRyYWN0Cg==", "contractType": "oas", "contentType": "application/yaml", "verificationResults": { "success": true, "content": "c29tZSByZXN1bHRz", "contentType": "text/plain", "format": "text", "verifier": "my custom tool", "verifierVersion": "1.0" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pf:ui": { "href": "some-url" } } }, "matchingRules": { "$.body._links.pf:ui.href": { "match": "type" } } } }, { "description": "a request for the index resource", "request": { "method": "get", "path": "/", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:webhooks": { "href": "http://localhost:1235/HAL-REL-PLACEHOLDER-PB-WEBHOOKS" }, "pb:pacticipants": { "href": "http://localhost:1235/HAL-REL-PLACEHOLDER-PB-PACTICIPANTS" }, "pb:pacticipant": { "href": "http://localhost:1235/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-{pacticipant}" } } }, "matchingRules": { "$.body._links.pb:webhooks.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.pb:pacticipants.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.pb:pacticipant.href": { "match": "regex", "regex": "http:\\/\\/.*{pacticipant}" } } } }, { "description": "a request to create a webhook for a team", "providerState": "a team with UUID 2abbc12a-427d-432a-a521-c870af1739d9 exists", "request": { "method": "post", "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" } }, "teamUuid": "2abbc12a-427d-432a-a521-c870af1739d9" } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "teamUuid": "2abbc12a-427d-432a-a521-c870af1739d9", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } } ], "metadata": { "pactSpecification": { "version": "2.0.0" } } }