pact-foundation / pact-specification

Describes the pact format and verification specifications
MIT License
295 stars 28 forks source link

V4: Tracking issue for support of synchronous messages #86

Closed uglyog closed 2 years ago

uglyog commented 3 years ago

Synchronous messages support a scheme were a request message is sent (via some messaging mechanism) and then a number response messages are expected back (could be from a different messaging mechanism, like a request is sent to one queue and the response comes back from another).

uglyog commented 3 years ago

Initial models to support this have been added to Pact-Rust. Sample JSON file format:

{
  "consumer": {
    "name": "consumer"
  },
  "interactions": [
    {
      "description": "Test Interaction",
      "key": "a0395223ce6c542b",
      "providerStates": [
        {
          "name": "Good state to be in"
        }
      ],
      "request": {
        "description": "Request Message",
        "key": "eb97728e3ed8475f",
        "contents": {
           "contentType": "application/json",
           "encoded": false,
           "content": {
              "a": "1234-1234"
           }
       },
        "type": "Asynchronous/Messages"
      },
      "response": [
        {
          "description": "Message Response",
          "key": "eb97728e3ed8475f",
           "contents": {
             "contentType": "application/json",
             "encoded": false,
             "content": {
                "a": "1234-1234"
             }
         },
          "type": "Asynchronous/Messages"
        }
      ],
      "type": "Synchronous/Messages"
    }
  ],
  "metadata": {
    "pactSpecification": {
      "version": "4.0"
    }
  },
  "provider": {
    "name": "write_pact_test_provider"
  }
}
bethesque commented 3 years ago

What does the key do?

uglyog commented 3 years ago

What does the key do?

72

bethesque commented 3 years ago

Sweet!

mefellows commented 2 years ago

I can't see this documented here https://github.com/pact-foundation/pact-specification/tree/version-4 Ron, should it be there now also?

uglyog commented 2 years ago

Now documented in the main readme