Azure / typespec-azure

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

Provide an API for non resource operations #1846

Open pshao25 opened 2 weeks ago

pshao25 commented 2 weeks ago

Following up the design for multi path issue and the API getArmResources it provides, we also need an API for the rest operations which are not resource operations.

markcowl commented 2 weeks ago

@pshao25 Let's discuss. Other than provider actions, non-resource operations should be modeled using Azure.Core or low-level http operations.

pshao25 commented 2 weeks ago

I'm thinking from SDK perspective, assume we now have getAllOperations from TCGC, resolveArmResources from TypeSpec library. We have to do below to filter out all the resource operations when generating all the non-resource operations. It's inconvenient.

foreach (operation in getAllOperations()) {
  if (operation in resolveArmResources().AllOperations) continue;
  else /* generate this operation */
}

It's better if we have some API called getNonResourceOperations, then we could do

foreach (operation in getNonResourceOperations()) {
  /* generate this operation */
}