-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: arrayContaining Matcher and the dynamic JSON keys. #108
Comments
Just noticed that arrayContaining method is implemented in v3, are there any chances that we could easily add that matcher without v4 ? |
I was able to implement some sort of
but PactBuilderTests:
Generated JSON: (Do we really need to duplicate internal array
But the final pact contacts doesn't include
Data that passed into mock server also looks ok |
Finally, got the example of
|
Hey @StasMarynych I've pulled the fork that refactored and massively rebased PactSwift code to take advantage of |
Hey @surpher , thats totally fine) np That mr was opened by the accident actually. Firstly, I wanted to be sure that current version of libpact_ffi that is in PactSwiftMockServer package supports that new type of matcher at all. Now, I see that everything is ok. So, if there is no |
Yes sure. There might be a caveat though where v2 is full on concurrency focused. Changes the set up and structure of pact tests. |
β Question
Are there any possibility to define the expected response in case of dynamic JSON keys (set of the different JSON objects)? For example something like arrayContaining in pact-js.
π¬ Context
The main problem is that the dynamic JSON objects are located in the array, so there can be more than 1 different object in the array. There is a predefined set of the possible objects, so if there are no any limitations I would consider implementing same matcher as in pact-js version. (I'd love to help with that or v4 specification implementation.)
JSON Sample
Notes:
By the way, there is an option to test such objects one by one (1 object in the array per test) using the provider state, but the main idea is to test the composition of such objects.
π€ Relationships
Looks like in v4 specification combine operators could be used, so that will solve the issue as well.
The text was updated successfully, but these errors were encountered: