Skip to content

Commit e897816

Browse files
authored
Fix common parameter issue (#150) (#152)
1 parent be4591f commit e897816

13 files changed

+458
-7
lines changed

openapi-diff/src/modeler/AutoRest.Swagger.Tests/Resource/Swagger/new/added_path.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
"version": "1.0"
66
},
77
"host": "localhost:8000",
8-
"schemes": [ "http", "https" ],
8+
"schemes": [
9+
"http",
10+
"https"
11+
],
912
"paths": {
1013
"/api/Paths": {
1114
"get": {
12-
"tag": [ "Paths" ],
15+
"tag": [
16+
"Paths"
17+
],
1318
"operationId": "Paths_Get",
1419
"produces": [
1520
"text/plain"
@@ -20,7 +25,9 @@
2025
},
2126
"/api/Operations": {
2227
"get": {
23-
"tag": [ "Operations" ],
28+
"tag": [
29+
"Operations"
30+
],
2431
"operationId": "Operations_Get",
2532
"produces": [
2633
"text/plain"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"swagger": 2.0,
3+
"info": {
4+
"title": "common_parameter_check_01",
5+
"version": "1.0"
6+
},
7+
"host": "localhost:8000",
8+
"schemes": [ "http", "https" ],
9+
"paths": {
10+
"/api/Operations": {
11+
"parameters": [
12+
{
13+
"name": "database",
14+
"in": "body",
15+
"type": "string"
16+
},
17+
{
18+
"name": "database2",
19+
"in": "body",
20+
"type": "string"
21+
}
22+
],
23+
"get": {
24+
"tag": [ "Operations" ],
25+
"operationId": "Operations_Get",
26+
"produces": [
27+
"text/plain"
28+
],
29+
"responses": {}
30+
}
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"swagger": 2.0,
3+
"info": {
4+
"title": "common_parameter_check_02",
5+
"version": "1.0"
6+
},
7+
"host": "localhost:8000",
8+
"schemes": [ "http", "https" ],
9+
"paths": {
10+
"/api/Operations": {
11+
"parameters": [
12+
{
13+
"name": "p2",
14+
"in": "header",
15+
"type": "string"
16+
},
17+
{
18+
"name": "p3",
19+
"in": "body",
20+
"type": "string",
21+
"required": true
22+
},
23+
{
24+
"name": "p4",
25+
"in": "body",
26+
"type": "string"
27+
}
28+
],
29+
"get": {
30+
"tag": [ "Operations" ],
31+
"operationId": "Operations_Get",
32+
"produces": [
33+
"text/plain"
34+
],
35+
"responses": {}
36+
}
37+
}
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"swagger": 2.0,
3+
"info": {
4+
"title": "common_parameter_check_03",
5+
"version": "1.0"
6+
},
7+
"host": "localhost:8000",
8+
"schemes": [ "http", "https" ],
9+
"paths": {
10+
"/api/Operations": {
11+
"parameters": [
12+
{
13+
"name": "p2",
14+
"in": "header",
15+
"type": "string"
16+
},
17+
{
18+
"name": "p3",
19+
"in": "body",
20+
"type": "string",
21+
"required": true
22+
}
23+
],
24+
"get": {
25+
"tag": [ "Operations" ],
26+
"operationId": "Operations_Get",
27+
"produces": [
28+
"text/plain"
29+
],
30+
"responses": {},
31+
"parameters": [
32+
{
33+
"name": "p1",
34+
"in": "body",
35+
"type": "string",
36+
"required": true
37+
},
38+
{
39+
"name": "p2",
40+
"in": "body",
41+
"type": "string"
42+
},
43+
{
44+
"name": "p3",
45+
"in": "body",
46+
"type": "string"
47+
}
48+
]
49+
}
50+
}
51+
}
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"swagger": 2.0,
3+
"info": {
4+
"title": "common_parameter_check_04",
5+
"version": "1.0"
6+
},
7+
"parameters": {
8+
"P0": {
9+
"name": "p0",
10+
"in": "body",
11+
"type": "string",
12+
"required": true
13+
},
14+
"P1": {
15+
"name": "p1",
16+
"in": "body",
17+
"type": "string"
18+
}
19+
},
20+
"host": "localhost:8000",
21+
"schemes": [ "http", "https" ],
22+
"paths": {
23+
"/api/Operations": {
24+
"parameters": [
25+
{
26+
"$ref": "#/parameters/P0"
27+
},
28+
{
29+
"$ref": "#/parameters/P1"
30+
}
31+
],
32+
"get": {
33+
"tag": [ "Operations" ],
34+
"operationId": "Operations_Get",
35+
"produces": [
36+
"text/plain"
37+
],
38+
"responses": {}
39+
}
40+
}
41+
}
42+
}

openapi-diff/src/modeler/AutoRest.Swagger.Tests/Resource/Swagger/old/added_path.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
"version": "1.0"
66
},
77
"host": "localhost:8000",
8-
"schemes": [ "http", "https" ],
8+
"schemes": [
9+
"http",
10+
"https"
11+
],
912
"paths": {
1013
"/api/Operations": {
1114
"get": {
12-
"tag": [ "Operations" ],
15+
"tag": [
16+
"Operations"
17+
],
1318
"operationId": "Operations_Get",
1419
"produces": [
1520
"text/plain"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"swagger": 2.0,
3+
"info": {
4+
"title": "common_parameter_check_01",
5+
"version": "1.0"
6+
},
7+
"host": "localhost:8000",
8+
"schemes": [ "http", "https" ],
9+
"paths": {
10+
"/api/Operations": {
11+
"parameters": [
12+
{
13+
"name": "database",
14+
"in": "body",
15+
"type": "string"
16+
}
17+
],
18+
"get": {
19+
"tag": [ "Operations" ],
20+
"operationId": "Operations_Get",
21+
"produces": [
22+
"text/plain"
23+
],
24+
"responses": {}
25+
}
26+
}
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"swagger": 2.0,
3+
"info": {
4+
"title": "common_parameter_check_02",
5+
"version": "1.0"
6+
},
7+
"host": "localhost:8000",
8+
"schemes": [ "http", "https" ],
9+
"paths": {
10+
"/api/Operations": {
11+
"parameters": [
12+
{
13+
"name": "p1",
14+
"in": "body",
15+
"type": "string",
16+
"required": true
17+
},
18+
{
19+
"name": "p2",
20+
"in": "body",
21+
"type": "string"
22+
},
23+
{
24+
"name": "p3",
25+
"in": "body",
26+
"type": "string"
27+
},
28+
{
29+
"name": "p4",
30+
"in": "body",
31+
"type": "string",
32+
"required": true
33+
}
34+
],
35+
"get": {
36+
"tag": [ "Operations" ],
37+
"operationId": "Operations_Get",
38+
"produces": [
39+
"text/plain"
40+
],
41+
"responses": {}
42+
}
43+
}
44+
}
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"swagger": 2.0,
3+
"info": {
4+
"title": "common_parameter_check_03",
5+
"version": "1.0"
6+
},
7+
"host": "localhost:8000",
8+
"schemes": [ "http", "https" ],
9+
"paths": {
10+
"/api/Operations": {
11+
"parameters": [
12+
{
13+
"name": "p1",
14+
"in": "body",
15+
"type": "object"
16+
},
17+
{
18+
"name": "p2",
19+
"in": "body",
20+
"type": "string"
21+
},
22+
{
23+
"name": "p3",
24+
"in": "body",
25+
"type": "string"
26+
}
27+
],
28+
"get": {
29+
"tag": [ "Operations" ],
30+
"operationId": "Operations_Get",
31+
"produces": [
32+
"text/plain"
33+
],
34+
"responses": {},
35+
"parameters": [
36+
{
37+
"name": "p1",
38+
"in": "body",
39+
"type": "string",
40+
"required": true
41+
},
42+
{
43+
"name": "p2",
44+
"in": "body",
45+
"type": "string"
46+
},
47+
{
48+
"name": "p3",
49+
"in": "body",
50+
"type": "string"
51+
}
52+
]
53+
}
54+
}
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"swagger": 2.0,
3+
"info": {
4+
"title": "common_parameter_check_04",
5+
"version": "1.0"
6+
},
7+
"parameters": {
8+
"P0": {
9+
"name": "p0",
10+
"in": "body",
11+
"type": "string"
12+
},
13+
"P1": {
14+
"name": "p1",
15+
"in": "body",
16+
"type": "string"
17+
}
18+
},
19+
"host": "localhost:8000",
20+
"schemes": [ "http", "https" ],
21+
"paths": {
22+
"/api/Operations": {
23+
"parameters": [
24+
{
25+
"$ref": "#/parameters/P0"
26+
},
27+
{
28+
"$ref": "#/parameters/P1"
29+
}
30+
],
31+
"get": {
32+
"tag": [ "Operations" ],
33+
"operationId": "Operations_Get",
34+
"produces": [
35+
"text/plain"
36+
],
37+
"responses": {}
38+
}
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)