grpc / grpc-dart

The Dart language implementation of gRPC.
https://pub.dev/packages/grpc
Apache License 2.0
860 stars 271 forks source link

Struct support? #533

Closed datdefboi closed 2 years ago

datdefboi commented 2 years ago

I use Struct type in the following message:

message Product{
  int32 id = 1;
  bool is_alcohol = 2;
  string brand = 3;
  google.protobuf.Struct parameters_map = 4;
  string title = 5;
  double weight = 6;
  bool is_fractional = 7;
}

Unfortunately, protoc generates the following import:

import 'google/protobuf/struct.pb.dart' as $0;

Obviously, I have no generated file

Build script:

protoc --dart_out=grpc:lib/generated -I../proto ../proto/models.proto
sigurdm commented 2 years ago

You need to include the well-known proto definitions yourself.

See: https://github.com/google/protobuf.dart/issues/170