Azure / Azure/typespec-rust

Consider adding switch to opt out of options type name disambiguation

Offen
#246 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Blocked CodeGen
Vorherrschende Sprache
Rust
Sterne
7
Forks
11
Ø Merge
2 T. 5 Std.
Gemergte PRs (30 T.)
5

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, das Benennungsverhalten für Option-Typen des Rust-Emitters zu überprüfen und mit der Behandlung eines einzelnen Clients durch den Go-Emitter zu vergleichen. Lege fest, wo der Opt-out-Schalter hingehört, wie mehrere Clients einen Fehler erzeugen sollten, und verifiziere, dass SDKs mit einem einzelnen Client das Client-Präfix weglassen, ohne das Standardverhalten zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.