Azure / typespec-azure

About TypeSpec Azure Libraries
https://azure.github.io/typespec-azure/
MIT License
15 stars 41 forks source link

Move `BodyParameter` definition to Azure.Core templates #1042

Open iscai-msft opened 5 months ago

iscai-msft commented 5 months ago

Clear and concise description of the problem

To clearly describe spreading behavior, we are vendoring template BodyParameter in specs if we don't want spread body parameters. We want to eventually move this to Azure.Core so we don't need to vendor. The options are either adding the template itself, like

model BodyParameter<T, name extends string = "body"> {
  @friendlyName(name)
  @bodyRoot body: T;
}

OR, by introducing a named parameter to templates, so spec authors would write this:

op doSomething<Something, BodyParameter=SomeParameters>

Checklist

allenjzhang commented 2 weeks ago

Captured in 1716 I prefer operation parameter override as it is widely used in ARM and is working well.