Add ConsumerVersionSelector Class #731
Labels
area:v3
Relating to the pact.v3 module
difficulty:medium
A moderate task requiring a good understanding of the codebase
type:feature
New feature
Have you read the Contributing Guidelines on issues?
Prerequisites
pact-python
.Description
Replace the
str
with a newConsumerVersionSelector
class, or equivalentkwargs
in:pact-python/src/pact/v3/verifier.py
Line 893 in c7f6667
Reproducible demo
No response
Steps to reproduce
Try using the
consumer_versions
key with most strings and the FFI call fails.Expected behavior
The end-user should not be responsible for manually serialising data into JSON. Instead, the Python implementation should provide a nice interface.
There could be two options for this implementation, ultimately implementing the following Rust struct:
https://github.com/pact-foundation/pact-reference/blob/fd1ba0c390267ae72be1a5b272fe314e904aa423/rust/pact_verifier/src/pact_broker.rs#L1026-L1083
The first option is to add a
TypedDict
class, and using theUnpack
typing annotation to help convert it into appropriatekwargs
. The other is to manually define thekwargs
as per the underlying struct.The JSON string would then be created within the method's logic.
Actual behavior
End user is responsible for generating valid JSON string.
Your environment
No response
Self-service
The text was updated successfully, but these errors were encountered: