Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 468d4be

Browse files
authoredApr 20, 2020
Add rule documentation for R1041 (Azure#161)
* add 1041 * update * update pipeline
1 parent 1d7e2dd commit 468d4be

File tree

2 files changed

+99
-2
lines changed

2 files changed

+99
-2
lines changed
 

‎azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ steps:
2020
inputs:
2121
pathtoPublish: $(Build.SourcesDirectory)/drop
2222

23-
- task: CredScan@2
23+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2 # CredScan@2
2424
inputs:
2525
toolMajorVersion: 'V2'
2626

27-
- task: PostAnalysis@1
27+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1 # PostAnalysis@1
2828
inputs:
2929
AllTools: false
3030
APIScan: false

‎docs/rules/1041.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
### 1041 - AddedPropertyInResponse
2+
3+
**Description**: Checks whether a property is added to the response model from the previous specification.
4+
5+
**Cause**: This is considered a breaking change.
6+
7+
**Example**: Property `c` is being added into model `Parameters` from response direction.
8+
9+
Old specification
10+
```json5
11+
{
12+
"swagger": "2.0",
13+
"info": {
14+
"title": "swagger",
15+
"description": "The Azure Management API.",
16+
"version": "2016-12-01",
17+
...
18+
...
19+
"paths:" {
20+
"/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1": {
21+
"get": {
22+
...
23+
"responses": {
24+
"200": {
25+
"schema": {
26+
"$ref": "#/definitions/Parameters"
27+
}
28+
}
29+
}
30+
}
31+
}
32+
"definitions": {
33+
...
34+
...
35+
"Parameters": {
36+
"properties": {
37+
"a": {
38+
"type": "string",
39+
"description": "Required. Property a."
40+
},
41+
"b": {
42+
"type": "string",
43+
"description": "Required. Enum Property b.",
44+
"enum": [ "b1", "b2" ]
45+
}
46+
},
47+
"description": "The parameters used when get operation."
48+
},
49+
...
50+
```
51+
52+
New specification
53+
```json5
54+
{
55+
"swagger": "2.0",
56+
"info": {
57+
"title": "swagger",
58+
"description": "The Azure Management API.",
59+
"version": "2016-12-01",
60+
...
61+
...
62+
"paths:" {
63+
"/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1": {
64+
"get": {
65+
...
66+
"responses": {
67+
"200": {
68+
"schema": {
69+
"$ref": "#/definitions/Parameters"
70+
}
71+
}
72+
}
73+
}
74+
}
75+
"definitions": {
76+
...
77+
...
78+
"Parameters": {
79+
"properties": {
80+
"a": {
81+
"type": "string",
82+
"description": "Required. Property a."
83+
},
84+
"b": {
85+
"type": "string",
86+
"description": "Required. Enum Property b.",
87+
"enum": [ "b1", "b2" ]
88+
},
89+
"c": {
90+
"type": "string",
91+
"description": "Read Only. Property c."
92+
}
93+
},
94+
"description": "The parameters used when get operation."
95+
},
96+
...
97+
```

0 commit comments

Comments
 (0)
Please sign in to comment.