Open
Description
Is your feature request related to a problem? Please describe.
The Pact ecosystem now supports plugins, and PactNet should be part of this. See https://docs.pact.io/plugins/quick_start
Describe the solution you'd like
The implementation details are entirely TBD currently, but some thoughts:
- It is not desirable to add more and more dependencies to PactNet and make the library bigger and bigger. Instead the plugins should be separate projects, e.g. in a
PactNet.Extensions.*
namespace format. - Plugins rely on FFI calls, which means that they need to load the FFI library and it has to be the same instance and version that the rest of the process has loaded so that it writes to the same Pact file in the same way etc.
- It was originally envisaged that plugins could add extensions methods to add appropriate functionality (e.g. a
WithProtobufContent
to mirror the existingWithJsonContent
calls) but the FFI aspect probably makes this pretty awkward - One solution may be to refactor the FFI interop parts out of
PactNet
and into a dedicatedPactNet.Interop
(or similar name) so that any plugin projects could depend on this and onPactNet.Abstractions
to add functionality in a non-breaking way. This refactor would be a breaking change upfront though so this idea would need to be properly thought out.
- It was originally envisaged that plugins could add extensions methods to add appropriate functionality (e.g. a
- Plugins are installed to the OS, which creates friction in PactNet itself because you would install e.g.
PactNet.Extensions.Protobuf
but that doesn't actually install the plugin, just the API support in PactNet. This can be confusing for users.
Breaking Changes
Depending on the implementation details above (TBD at the time of writing) this may involve breaking changes.
Potential Downsides/Caveats
Describe alternatives you've considered
Additional context