Azure / typespec-azure

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

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

Open iscai-msft opened 2 weeks ago

iscai-msft commented 2 weeks 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