Azure / typespec-azure

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

Have `@usage` decorator apply to operations #1301

Open iscai-msft opened 2 months ago

iscai-msft commented 2 months ago

Clear and concise description of the problem

We have @usage for individual models and properties: we want to be able to apply this to all models referenced by an operation through a decorator that takes in an operation. More granularity down the line wins out

| Decorator State                   | Model with Public Usage | Model with Private Usage | Model without Usage |
|-----------------------------------|-------------------------|--------------------------|---------------------|
| `@usage(Usage.None)`              | Used                    | Used                     | Not Used            |
| `@usage(Usage.Input/Usage.Output)`| Used                    | Used                     | Used                |

Checklist

tadelesh commented 2 months ago

i think it is meaningless to set @usage to any value except roundtrip. what is the real scenario for this?