pact-foundation / pact-support

Shared code for Pact gems
MIT License
7 stars 47 forks source link

Initial support for specification v3 combined matchers #86

Open maximvl opened 3 years ago

maximvl commented 3 years ago

Hello, following the discussion here https://github.com/pact-foundation/pact-js/issues/51 I experimented with v3 combine matchers and it seems it can be used to implement optional types. As I'm not an expert in Ruby feel free to comment on style/logic. I will take care of tests and improvements later.

maximvl commented 3 years ago

Recently I found there is a python implementation which supports v3, i think it will be enough for my case. closing this one.

bethesque commented 3 years ago

I might keep going on this, as it needs to be implemented anyway.

dimitar-aleksov-cardano commented 7 months ago

@maximvl I know it's been years since this issue was discussed, but could you point me to this python implementation, that makes use of the combine matcher? I am running into the same issue, that was discussed in https://github.com/pact-foundation/pact-js/issues/51, my provider API returns a list of objects and some of the fields are optional. Therefore, I'd like to make use of a kind of combine matcher, that verifies both None and complex objects. Thanks in advance!

YOU54F commented 3 months ago

converting this to a draft, as there is some additional work required before this can be merged

@dimitar-aleksov-cardano - please follow the pact-python blog, it currently doesn't support v3 combined matchers but it ia moving towards the pact-rust implementation which does.

https://pact-foundation.github.io/pact-python/blog/

The tracking ticket is https://github.com/pact-foundation/pact-python/issues/396

it is worth noting that pact-jvm supports AND/OR from V3 spec compat onwards however pact-reference does not expose the OR functionality via the FFI which client libraries will be leveraging for shared core functionality (migrating away from the rust core which most libraries have now down)

https://github.com/pact-foundation/pact-reference/issues/399#issuecomment-2104431926