danielgtaylor / danielgtaylor/python-betterproto
Mixed case request results in missing request parameters in generated code
- 主要语言
- Python
- 星标
- 1.8k
- 派生
- 234
- PR 合并指标
- 30 天内没有已合并 PR
描述
Version: betterproto==2.0.0b3
Requests with capital letters in the name seem to cause an issue with constructing methods. The request parameters are not added to the method. e.g
proto file:
```
rpc TestCAPITALS(TestCAPITALSRequest) returns (TestCAPITALSResponse){}
message TestCAPITALSRequest{
string name = 1;
}
message TestCAPITALSResponse{}
```
generated class:
```
async def test_capitals(self) -> "TestCapitalsResponse":
request = TestCapitalsRequest()
return await self._unary_unary(
"/tumelo.transparency.v1.InstrumentPortfolioTransparency/TestCAPITALS",
request,
TestCapitalsResponse,
)
```
we would expect a `name` field in the request but it is not there
贡献指南
调研方向
从 issue 中显示的大小写混合的 RPC 和 request 定义开始,然后将它们与生成的 async 方法和 request 构造进行比较。跟踪将 RPC 名称和消息名称转换为方法的代码生成路径,并确认生成的 request 保留了 name 字段。当示例方法包含 request 参数,同时保留 RPC 路径和响应类型时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- grpc, python
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100