danielgtaylor / danielgtaylor/python-betterproto

Missing betterproto_lib_google_protobuf import if only used as rpc call parameter.

オープン
#409 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
compiler-bug
主要言語
Python
スター
1.8k
フォーク
234
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm using 2.0.0b5.

The following file results in broken python:

```proto
syntax = "proto3";

package experiment;

import "google/protobuf/empty.proto";

message Reply {
bool happy = 1;
}

service Testcase {
rpc call(google.protobuf.Empty) returns (Reply);
}
```

Specifically, the import `import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf` is missing from the output file.

When any `google.protobuf` imported field is used anywhere else, it does work correctly, for example, the following files all work:

```proto
syntax = "proto3";

package experiment;

import "google/protobuf/empty.proto";

message Reply {
bool happy = 1;
}

service Testcase {
rpc call(Reply) returns (google.protobuf.Empty);
}
```

```proto
syntax = "proto3";

package experiment;

import "google/protobuf/empty.proto";

message Reply {
bool happy = 1;
google.protobuf.Empty e = 2;
}

service Testcase {
rpc call(google.protobuf.Empty) returns (Reply);
}

```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。