Azure / Azure/azure-openapi-validator

[new rule]: Path parameter names in different API path should be consistent in one RP

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

Description

### Lint rule description

Path parameter names in different API path should be consistent in one RP. If there is a API definition "/A/{name}", then its child API definitions should use the same path parameter name "{name}", like "/A/{name}/B", NOT "/A/{Aname}/B"

### Related swagger example

1. Compute The below 2 API below are share the same context, but unfortunately they are using different virtual machine scale set name (e.g. {virtualMachineScaleSetName} v.s. {vmScaleSetName}. - https://github.com/Azure/azure-rest-api-specs/blob/2c6bb907c749885e933bdb4e1a40f71bd9a60c3a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/compute.json#L7587 - https://github.com/Azure/azure-rest-api-specs/blob/2c6bb907c749885e933bdb4e1a40f71bd9a60c3a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/compute.json#L7651 2. Web The below 2 API use different web site names (e.g. {siteName} v.s. {name}). They are defined 2 files, but belong to the same RP. - https://github.com/Azure/azure-rest-api-specs/blob/2c6bb907c749885e933bdb4e1a40f71bd9a60c3a/specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/Diagnostics.json#L327 - https://github.com/Azure/azure-rest-api-specs/blob/2c6bb907c749885e933bdb4e1a40f71bd9a60c3a/specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/WebApps.json#L97

2.
https://github.com/Azure/azure-rest-api-specs/pull/18660
### Category

SDK

### Severity level

Error

### Applies to

Management plane API spec, Data plane API spec, RPaaS API spec

### How to fix the violation

consider using the same parameter name in different API path

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

will bring confusion and inconsistency

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.