Azure / Azure/typespec-rust

Consider adding switch to opt out of options type name disambiguation

未关闭
#246 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Blocked CodeGen
主要语言
Rust
星标
7
派生
11
平均合并
2 天 5 小时
30 天内合并 PR
5

描述

For `FooClient`, all client/client method options will have the prefix `FooClient`. This is to disambiguate the case when an SDK contains multiple clients and two (or more) clients have a method with the same name (e.g. `SomeMethod`), Without the prefix, `SomeMethodOptions` would collide.

For SDKs with a single client, and that will _always_ have a single client, the prefix is unnecessary and creates ugly names. We could consider adding a switch to opt out of this prefix. It works IFF an SDK contains a single client, else an error is generated (this is what we do in the go emitter). Note that opting in and then later opting out would result in a breaking change. So, one must be 100% confident that the SDK in question will always contain only one client.

贡献指南

打开贡献指南

调研方向

首先检查 Rust emitter 的选项类型命名行为,并将其与 Go emitter 对单个 client 的处理进行比较。确定 opt-out switch 应放置在哪里、多个 client 应如何产生错误,并验证单 client SDK 会省略 client 前缀,同时不改变默认行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
rust
领域
tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。