Azure / Azure/typespec-rust

Consider adding switch to opt out of options type name disambiguation

Đang mở
#246 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Blocked CodeGen
Ngôn ngữ chính
Rust
Star
7
Fork
11
Merge trung bình
2 ngày 5 giờ
Pull request đã merge (30 ngày)
5

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xem xét hành vi đặt tên kiểu tùy chọn của Rust emitter và so sánh với cách Go emitter xử lý một client duy nhất. Xác định switch opt-out thuộc về đâu, nhiều client sẽ tạo ra lỗi như thế nào, và xác minh rằng các SDK có một client duy nhất bỏ qua tiền tố client mà không thay đổi hành vi mặc định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.