Ringo
12/13/2022, 2:55 PMservice LanguageRuntime {
// About returns information about the runtime for this language.
rpc About(google.protobuf.Empty) returns (AboutResponse) {}
}
// AboutResponse returns runtime information about the language.
message AboutResponse {
string executable = 1; // the primary executable for the runtime of this language.
string version = 2; // the version of the runtime for this language.
map<string, string> metadata = 3; // other information about this language.
}
I have this as my grpcInteration
object so far:
grpcInteraction := `{
"pact:proto": "` + filepath.ToSlash(dir) + `",
"pact:proto-service": "LanguageRuntime/About",
"pact:content-type": "application/protobuf",
"request": {
},
"response": {
"executable": "matching(type, 'pulumi')",
"version": "matching(type, '3.48.0')",
"metadata": {
"matching(type, 'someKey')": "matching(type, 'somevalue')"
}
}
}`
The error I get is this, and I get head nor tail to it:
2022-12-13T14:51:19.060937Z ERROR ThreadId(01) pact_ffi::plugins: Failed to call out to plugin - Request to configure interaction failed: Failed to process protobuf: For message fields, you need to define a Map of expected fields, got String("matching(type, 'somevalue')")
I tried various things already for the free form metadata
field so far, but to no avail. I haven’t found any example which has a map
in the proto file that I can copy from. What is the correct way to write this?Ringo
12/13/2022, 3:24 PM• Map fields with scalar keys.https://github.com/pactflow/pact-protobuf-plugin#unsupported-features
uglyog
uglyog
"metadata": "eachKey(matching(type, 'someKey')), eachValue(matching(type, 'somevalue'))"
Ringo
12/23/2022, 10:54 AM