https://developers.google.com/protocol-buffers/docs/reference/google.protobuf lists all the well known types, but the URLs needed to import them into your .proto file are a secret. The only one I can find any reference to is Any, import "google/protobuf/any.proto". Others like Empty or any of the wrappers are undocumented.
FYI for those who can't seem to find the well known types in the docs. All wrappers (ie. int32Value) are under wrappers.proto.
import "google/protobuf/any.proto";
import "google/protobuf/api.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/source_context.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/type.proto";
import "google/protobuf/wrappers.proto";
Found a sample in a unit test:
Still not fixed? I'm trying to import ListValue and can't find any reference of the import.
Just ran into the problem @otto-dev
import "google/protobuf/struct.proto";
google.protobuf.ListValue foo = 1;
seems to work
from google.protobuf import struct_pb2
struct_pb2.ListValue().add_list().extend([1,2,3])
Most helpful comment
FYI for those who can't seem to find the well known types in the docs. All wrappers (ie. int32Value) are under wrappers.proto.
Found a sample in a unit test: