Add linting rule to validate ops in arm interface are all for the same resource
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 90
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 156
Description
So in general, we would like to establish a standard in new management typespec that the operations belong to the same resource, should come in one same interface, such as:
```
interface VirtualMachines
{
get is ArmResourceRead;
createOrUpdate is ArmResourceCreateOrUpdate;
}
```
and we should be trying to avoid this case:
```
interface VirtualMachines
{
get is ArmResourceRead;
createOrUpdate is ArmResourceCreateOrUpdate; // this should go to its own interface `VirtualMachineScaleSets`
}
```
Therefore could we add some validations in the decorator `@armResourceOperations(Model)` to let it validate if all the operations in the same interface to have the same `Resource` argument?
Contributor guide
Research direction
Start at the @armResourceOperations(Model) decorator and trace how its current validations inspect operations in an interface. Define done as reporting a validation failure when operations use different Resource arguments, while allowing operations that target the same resource; the issue provides the expected valid and invalid interface examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100