Stanislav Vodetskyi
01/25/2024, 1:29 AMeachValue()
but that seems to work only for simple value fields.
I'm currently doing smth like this, but this defines one element, and I'm not sure how to specify counts. @rholshausen you've added atLeast
and atMost
but I'm not sure where to put it, should it be just the element in the list? Thanks!
{
"availability_zones": [
{
"cloud_provider": "notEmpty('AWS')",
"zone_name": "notEmpty('us-east-1a')"
}
]
}
Stanislav Vodetskyi
01/25/2024, 1:33 AMThe final form is a reference to another key. This is used to setup type matching using an example value, and is normally used for collections. The name of the key must be a string value in single quotes.
For example, to configure a type matcher where each value in a list must match the definition of a person:
{
"pact:match": "eachValue(matching($'person'))",
"person": {
"name": "Fred",
"age": 100
}
}
Stanislav Vodetskyi
01/25/2024, 2:00 AMconfig
field in my response, can I just refer to it from under the custom_config?
message Config {}
message CustomConfig {
Config config = 1;
string whatever = 2;
}
message Response {
Config config = 1;
CustomConfig custom_config = 2;
}
rholshausen
01/25/2024, 3:55 AMatLeast
and atMost
are currently a work in progress, and will be able with the next release of the protobuf pluginrholshausen
01/25/2024, 4:19 AMso in this final form of matching syntax, is the field name looked up on the same level or across all of the proto?It's defined on the same level
Stanislav Vodetskyi
01/26/2024, 12:12 AM