fix(codegen): Use wellknown types from prost-types (#49)
This change introduces the ability to let prost-build provide the fully qualifed type path for types that start with `google.protobuf`.
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package empty;
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service Admin {
|
||||
rpc EmptyCall(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wellknown;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/any.proto";
|
||||
|
||||
service Admin {
|
||||
rpc EmptyCall(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
rpc StringCall(google.protobuf.StringValue) returns (google.protobuf.Empty);
|
||||
rpc AnyCall(google.protobuf.Any) returns (google.protobuf.Empty);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
#[test]
|
||||
fn empty() {
|
||||
fn wellknown() {
|
||||
let tmp = std::env::temp_dir();
|
||||
tonic_build::configure()
|
||||
.out_dir(tmp)
|
||||
.format(false)
|
||||
.compile(&["tests/protos/empty.proto"], &["tests/protos"])
|
||||
.compile(&["tests/protos/wellknown.proto"], &["tests/protos"])
|
||||
.unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user