-
Notifications
You must be signed in to change notification settings - Fork 145
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of
pact-python. - I have read the console error message carefully (if applicable).
Description
Replace the str with a new ConsumerVersionSelector class, or equivalent kwargs in:
pact-python/src/pact/verifier.py
Lines 1445 to 1450 in 88cb896
| def consumer_versions(self, *versions: str) -> Self: | |
| """ | |
| Set the consumer versions. | |
| """ | |
| self._consumer_versions = list(versions) | |
| return self |
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:
The first option is to add a TypedDict class, and using the Unpack typing annotation to help convert it into appropriate kwargs. The other is to manually define the kwargs 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
- I'd be willing to fix this bug myself.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status