Whats the proper way to use matcher for matching e...
# protobufs
s
Whats the proper way to use matcher for matching eachValue inside a list of items. I have a grpc request where one of the field value is a list of items. I am looking to properly match eachValue inside the list. The below does not seem to work. could someone please help ? "item": ['somevalue1', 'somevalue2']
"item": "eachValue(matching(type, 'value'))"
u
In what way does it not seem to work?
s
Here is the error i am getting from pact-plugin
pact_protobuf_plugin::mock_service: Failed to match the request message - BodyMismatches({"$.item": [BodyMismatch { path: "$.item[0]", expected: Some(b""), actual: Some(b"00000000000000000000000000000000"), mismatch: "Unable to match '' using EachValue(MatchingRuleDefinition { value: \"00000000000000000000000000000000\", value_type: Unknown, rules: [Left(Type)], generator: None })" }]})
u
Looks like it might be a bug with the EachValue matcher, I'll have to investigate
thankyou 1
s
Thanks @uglyog I have opened an issue with pact-plugin here: https://github.com/pact-foundation/pact-plugins/issues/22