Skip to content

Commit eaf2b53

Browse files
rkmandajianyexi
andauthored
Add linter rule for RPC-Get-V1-02 (Azure#425)
* Adding RPC guideline code * organizing ARM RPC rules * Enable linter rule for RPC-Get-V1-02 * addressing comments * Update packages/rulesets/src/spectral/az-arm.ts accepting the suggestion for the given paths Co-authored-by: Jianye Xi <[email protected]> * rush build generated files Co-authored-by: Jianye Xi <[email protected]>
1 parent f211e0f commit eaf2b53

File tree

7 files changed

+334
-156
lines changed

7 files changed

+334
-156
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# GetMustNotHaveRequestBody
2+
3+
## Category
4+
5+
ARM Error
6+
7+
## Applies to
8+
9+
ARM OpenAPI(swagger) specs
10+
11+
## Related ARM Guideline Code
12+
13+
- RPC-Get-V1-02
14+
15+
## Output Message
16+
17+
'Get' operation '{0}' must not have a request body.
18+
19+
## Description
20+
21+
The request body of a get operation must be empty.
22+
23+
## Why the rule is important
24+
25+
This will ensure that the get operation aligns with the [ARM guidelines](https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md).
26+
27+
## How to fix the violation
28+
29+
Ensure that the request body of the get operation is empty. This may involve a service side change and may cause a breaking change in the generated SDK.

docs/rules.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,12 @@ Verifies whether value for `operationId` is named as per ARM guidelines.
328328

329329
Please refer to [get-in-operation-name.md](./get-in-operation-name.md) for details.
330330

331+
### GetMustNotHaveRequestBody
332+
333+
The request body of a get operation must be empty.
334+
335+
Please refer to [get-must-not-have-request-body.md](./get-must-not-have-request-body.md) for details.
336+
331337
### GetOperation200
332338

333339
The get operation should only return 200, also it should not be a long running operation.

0 commit comments

Comments
 (0)