Open l0lawrence opened 1 month ago
I see the need for this decorator, what about something like @parameterScope
. Going to post this in the dpg sync chat and have people respond
similar with https://github.com/Azure/typespec-azure/issues/493?
main.tsp
interface foo { op myOp(x: int, y: int) : void }
client.tsp
@clientName("FooClientOptions", "csharp") model myClientInitModel { x: int; }
@@client(foo, { additionalInitialization: myClientInitModel })
//typegraph from tcgc
SdkOperation { parameters: [ {x: int, location: client}, { y: int, location: operation } ] }
SdkMethod { parameters: [ { y: int, location: operation } ] }
similar with #493?
Yes, I agree it's a duplicate, I'm closing #493
Is it possible to move parameters that persist on each operation to the client instead with a decorator of some sort? In EventGrid this shows up in the case of
client() publish(topic_name, events) receive(topic_name, subscription_name, max_events) ack(topic_name, subscription_name, lock_tokens)
to
client(topic_name, subscription_name) publish(events) receive(max_events) ack(lock_tokens)
typespec spec: https://github.com/Azure/azure-rest-api-specs/blob/9df71d5a717e4ed5e6728e7e6ba2fead60f62243/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L261