#4 Feature Request: Implement API for generating contract using the v4 Pact Specification
Issue created by adamdamaContext
We are currently undergoing a large scale project of adding contract testing to components being run on embedded devices. As embedded device components they are written in either C++ or Rust and compiled to binaries which are delivered out to the hardware devices.
These components communicate between each other primarily in 5 ways:
• Request + Response over HTTP
• Synchronous Message interactions over WebSockets
• Asynchronous Message interactions over WebSockets
• Synchronous Message interactions over dbus
• Asynchronous Message interactions over dbus
For the HTTP Request + Response and asynchronous messages the current implementation of the C++ library using the v3 spec is sufficient. However a large amount of our inter-component communications are synchronous messages over WebSockets. We have not yet started looking at the dbus communications but that will come up in the not so distant future.
We have written a pact plugin that supports WebSocket connections and have started using this to create contract tests between the components. This works really nicely in Rust as the Rust API is the reference and has support for synchronous message contracts and also loading plugins. However in C++ we have resorted to using the FFI functions directly. While this is working we feel that the developer experience is worse and there is a larger amount of effort involved when compared to using the fluid API interface of the pact-cplusplus library.
We would like to be able to use the pact-cpluscplus library to create Pact v4 spec contracts so that we can A) load plugins WebSockets and likely in the future dbus and B) create synchronous message contracts. Therefore we are requesting that the library be updated to offer this functionality.