Skip to content
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

Issue with matching a map #62

Open
tienvx opened this issue May 12, 2024 · 0 comments
Open

Issue with matching a map #62

tienvx opened this issue May 12, 2024 · 0 comments

Comments

@tienvx
Copy link
Contributor

tienvx commented May 12, 2024

I can't match a map in protobuf. Here is the protobuf file:

syntax = "proto3";

package library;

message Person {
  string id = 1;
  Name name = 2;
  map<string, int32> children = 3;
}

message Name {
  string given = 1;
  string surname = 2;
}

Here is the message content:

{
  "pact:proto": "/home/tien/Projects/pact/pact-php/example/protobuf-async-message/consumer/tests/MessageHandler/../../../library/proto/say_hello.proto",
  "pact:message-type": "Person",
  "pact:content-type": "application/protobuf",
  "id": "matching(regex, '^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$', 'd1f077b5-0f91-40aa-b8f9-568b50ee4dd9')",
  "name": {
    "given": "matching(type, 'Given')",
    "surname": "matching(type, 'Surname')"
  },
  "children": "eachKey(matching(type, 'some string')), eachValue(matching(number, 23)), atLeast(0), atMost(3)"
}

Here is the log:

2024-05-12T06:46:11.193163Z ERROR ThreadId(01) pact_ffi::plugins: Failed to call out to plugin - Request to configure interaction failed: Failed to process protobuf: Map fields need to be configured with a Map, got String("eachKey(matching(type, 'some string')), eachValue(matching(number, 23)), atLeast(0), atMost(3)")

Here is the code https://github.com/pact-foundation/pact-php/pull/602/files

FFI Version: 0.4.19

What did I do wrong? What can I do instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant