-
Notifications
You must be signed in to change notification settings - Fork 18
Description
β 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
{
"items": [
{
"id": "some-id1",
"config": {
"foo": "true"
}
},
{
"id": "some-id2",
"config": {
"bar": { ... }
}
},
{
"id": "some-id3",
"config": {
"baz": 100
}
}
]
}
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.
- Other Related Issues: Question: What about Pact Specification v4?Β #107