Azure / Azure/azure-openapi-validator

[new rule]: Checking path parameter name consistency

Open
#388 2 comments 0 reactions 0 assignees View on GitHub
sdk-rule
Dominant language
TypeScript
Stars
53
Forks
57
Avg merge
1d 23h
Merged PRs (30d)
2

Description

### Lint rule description

For instance we have a path:
```
/subscriptions/{subsId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{name}
```
and any sub-path whose parent is this path, should have exactly the same prefix as the above path, including the variable names.
```
/subscriptions/{subsId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{name}/start
```
this is acceptable, but this
```
/subscriptions/{subsId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff
```
is not acceptable.

### Related swagger example

The changes in this PR https://github.com/Azure/azure-rest-api-specs/pull/20588 is aligning such a parameter name between two paths.

### Category

SDK

### Severity level

Error

### Applies to

Management plane API spec, Data plane API spec

### How to fix the violation

The swagger should rename the violated parameter name to keep them aligned with each other across different paths with parenting relationship

### What't the impact if breaking the rule

This benefits the tools that validate parenting relationship between operations and resources, and will make the generated SDKs have aligned parameter names

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.