-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Generate the python GAPIC library with the following proto:
// in googleapis/google/cloud/mypackge/v1/some.proto
syntax = "proto3";
package google.cloud.mypackage;
message Outer {
AMap inner = 1;
}
message AMap {
map<string, Stuff> some_mapping = 1;
}
message Stuff {}
The resulting library cannot be used to create certain Outer messages:
(1)
mypackage.Outer(inner={'some_mapping': {'a': {}}})
raises TypeError: Parameter to MergeFrom() must be instance of same class: expected google.cloud.mypackage.Stuff got dict..
(2)
mypackage.Outer(inner={'some_mapping': {'a': mypackage.Stuff()}})
raises TypeError: Parameter to MergeFrom() must be instance of same class: expected google.cloud.mypackage.Stuff got Stuff..
(3)
mypackage.Outer(inner=mypackage.AMap(some_mapping={'a': mypackage.Stuff()}))
works fine, and builds:
inner {
some_mapping {
key: "a"
value {
}
}
}
aabmass
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.