get fails when there is a *structpb.Struct in referenced model
Sheshagiri opened this issue · 0 comments
Sheshagiri commented
Error
panic: reflect.Set: value of type *structpb.Struct is not assignable to type *models.ActionExecutionSpecDBModel
goroutine 1 [running]:
reflect.Value.assignTo(0x9d32c0, 0xc0002dfc50, 0x16, 0xa163b8, 0xb, 0x9d2bc0, 0x0, 0xc0002de540, 0xee87f0, 0xc00030a4e0)
/usr/lib/golang/src/reflect/value.go:2339 +0x437
reflect.Value.Set(0x9d2bc0, 0xc000244600, 0x196, 0x9d32c0, 0xc0002dfc50, 0x16)
/usr/lib/golang/src/reflect/value.go:1473 +0xa8
github.com/Sheshagiri/go-protobuf-cloud-datastore-entity-translator/datastore-translator.DatastoreEntityToProtoMessage(0xc0002de2a0, 0xad74a0, 0xc000244580, 0xc00026c601, 0xc0002de2a0, 0x0)
protobuf
syntax = "proto3";
package models;
import "google/protobuf/struct.proto";
message ReferenceDBModel {
string ref = 1;
google.protobuf.Struct parameters = 2;
}
message DBModel {
string id = 1;
ReferenceDBModel ref_model = 2;
}