Skip to content

Commit c671429

Browse files
authored
Fix Swagger Correctness Issues (#15185)
1 parent 7a4a643 commit c671429

File tree

4 files changed

+121
-103
lines changed

4 files changed

+121
-103
lines changed

specification/addons/resource-manager/Microsoft.Addons/preview/2017-05-15/Addons.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"200": {
4949
"description": "List all the operations.",
5050
"schema": {
51-
"$ref": "#/definitions/OperationList"
51+
"$ref": "#/definitions/OperationListValue"
5252
}
5353
},
5454
"default": {
@@ -327,6 +327,15 @@
327327
}
328328
}
329329
},
330+
"OperationListValue": {
331+
"type": "object",
332+
"description": "List of supported operations.",
333+
"properties": {
334+
"value": {
335+
"$ref": "#/definitions/OperationList"
336+
}
337+
}
338+
},
330339
"OperationList": {
331340
"type": "array",
332341
"description": "List of supported operations.",
@@ -384,10 +393,8 @@
384393
"description": "Description of the error."
385394
},
386395
"code": {
387-
"type": "integer",
388-
"description": "Service specific error code which serves as the substatus for the HTTP error code.",
389-
"minimum": 100,
390-
"maximum": 600
396+
"type": "string",
397+
"description": "Service specific error code which serves as the substatus for the HTTP error code."
391398
}
392399
}
393400
}

specification/addons/resource-manager/Microsoft.Addons/preview/2017-05-15/examples/Operations_List.json

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,55 @@
44
},
55
"responses": {
66
"200": {
7-
"body": [
8-
{
9-
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/read",
10-
"display": {
11-
"provider": "Microsoft Addons",
12-
"resource": "supportPlanTypes",
13-
"operation": "Get Canonical support plan state",
14-
"description": "Get the specified Canonical support plan state."
7+
"body": {
8+
"value": [
9+
{
10+
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/read",
11+
"display": {
12+
"provider": "Microsoft Addons",
13+
"resource": "supportPlanTypes",
14+
"operation": "Get Canonical support plan state",
15+
"description": "Get the specified Canonical support plan state."
16+
}
17+
},
18+
{
19+
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/write",
20+
"display": {
21+
"provider": "Microsoft Addons",
22+
"resource": "supportPlanTypes",
23+
"operation": "Adds a Canonical support plan.",
24+
"description": "Adds the Canonical support plan type specified."
25+
}
26+
},
27+
{
28+
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/delete",
29+
"display": {
30+
"provider": "Microsoft Addons",
31+
"resource": "supportPlanTypes",
32+
"operation": "Removes the Canonical support plan",
33+
"description": "Removes the specified Canonical support plan"
34+
}
35+
},
36+
{
37+
"name": "Microsoft.Addons/supportProviders/canonical/supportPlanTypes/get",
38+
"display": {
39+
"provider": "Microsoft Addons",
40+
"resource": "supportProviders",
41+
"operation": "Gets available Canonical support plan types.",
42+
"description": "Gets the available Canonical support plan types as well as some extra metadata on their enabled status."
43+
}
44+
},
45+
{
46+
"name": "Microsoft.Addons/register/action",
47+
"display": {
48+
"provider": "Microsoft Addons",
49+
"resource": "register",
50+
"operation": "Register for Microsoft.Addons",
51+
"description": "Register the specified subscription with Microsoft.Addons"
52+
}
1553
}
16-
},
17-
{
18-
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/write",
19-
"display": {
20-
"provider": "Microsoft Addons",
21-
"resource": "supportPlanTypes",
22-
"operation": "Adds a Canonical support plan.",
23-
"description": "Adds the Canonical support plan type specified."
24-
}
25-
},
26-
{
27-
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/delete",
28-
"display": {
29-
"provider": "Microsoft Addons",
30-
"resource": "supportPlanTypes",
31-
"operation": "Removes the Canonical support plan",
32-
"description": "Removes the specified Canonical support plan"
33-
}
34-
},
35-
{
36-
"name": "Microsoft.Addons/supportProviders/canonical/supportPlanTypes/get",
37-
"display": {
38-
"provider": "Microsoft Addons",
39-
"resource": "supportProviders",
40-
"operation": "Gets available Canonical support plan types.",
41-
"description": "Gets the available Canonical support plan types as well as some extra metadata on their enabled status."
42-
}
43-
},
44-
{
45-
"name": "Microsoft.Addons/register/action",
46-
"display": {
47-
"provider": "Microsoft Addons",
48-
"resource": "register",
49-
"operation": "Register for Microsoft.Addons",
50-
"description": "Register the specified subscription with Microsoft.Addons"
51-
}
52-
}
53-
]
54+
]
55+
}
5456
}
5557
}
5658
}

specification/addons/resource-manager/Microsoft.Addons/preview/2018-03-01/addons-swagger.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"200": {
4949
"description": "List all the operations.",
5050
"schema": {
51-
"$ref": "#/definitions/OperationList"
51+
"$ref": "#/definitions/OperationListValue"
5252
}
5353
},
5454
"default": {
@@ -336,6 +336,15 @@
336336
}
337337
}
338338
},
339+
"OperationListValue": {
340+
"type": "object",
341+
"description": "List of supported operations.",
342+
"properties": {
343+
"value": {
344+
"$ref": "#/definitions/OperationList"
345+
}
346+
}
347+
},
339348
"OperationList": {
340349
"type": "array",
341350
"description": "List of supported operations.",
@@ -393,10 +402,8 @@
393402
"description": "Description of the error."
394403
},
395404
"code": {
396-
"type": "integer",
397-
"description": "Service specific error code which serves as the substatus for the HTTP error code.",
398-
"minimum": 100,
399-
"maximum": 600
405+
"type": "string",
406+
"description": "Service specific error code which serves as the substatus for the HTTP error code."
400407
}
401408
}
402409
}
Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,58 @@
11
{
22
"parameters": {
3-
"api-version": "2017-05-15"
3+
"api-version": "2018-03-01"
44
},
55
"responses": {
66
"200": {
7-
"body": [
8-
{
9-
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/read",
10-
"display": {
11-
"provider": "Microsoft Addons",
12-
"resource": "supportPlanTypes",
13-
"operation": "Get Canonical support plan state",
14-
"description": "Get the specified Canonical support plan state."
7+
"body": {
8+
"value": [
9+
{
10+
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/read",
11+
"display": {
12+
"provider": "Microsoft Addons",
13+
"resource": "supportPlanTypes",
14+
"operation": "Get Canonical support plan state",
15+
"description": "Get the specified Canonical support plan state."
16+
}
17+
},
18+
{
19+
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/write",
20+
"display": {
21+
"provider": "Microsoft Addons",
22+
"resource": "supportPlanTypes",
23+
"operation": "Adds a Canonical support plan.",
24+
"description": "Adds the Canonical support plan type specified."
25+
}
26+
},
27+
{
28+
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/delete",
29+
"display": {
30+
"provider": "Microsoft Addons",
31+
"resource": "supportPlanTypes",
32+
"operation": "Removes the Canonical support plan",
33+
"description": "Removes the specified Canonical support plan"
34+
}
35+
},
36+
{
37+
"name": "Microsoft.Addons/supportProviders/canonical/supportPlanTypes/get",
38+
"display": {
39+
"provider": "Microsoft Addons",
40+
"resource": "supportProviders",
41+
"operation": "Gets available Canonical support plan types.",
42+
"description": "Gets the available Canonical support plan types as well as some extra metadata on their enabled status."
43+
}
44+
},
45+
{
46+
"name": "Microsoft.Addons/register/action",
47+
"display": {
48+
"provider": "Microsoft Addons",
49+
"resource": "register",
50+
"operation": "Register for Microsoft.Addons",
51+
"description": "Register the specified subscription with Microsoft.Addons"
52+
}
1553
}
16-
},
17-
{
18-
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/write",
19-
"display": {
20-
"provider": "Microsoft Addons",
21-
"resource": "supportPlanTypes",
22-
"operation": "Adds a Canonical support plan.",
23-
"description": "Adds the Canonical support plan type specified."
24-
}
25-
},
26-
{
27-
"name": "Microsoft.Addons/supportProviders/supportPlanTypes/delete",
28-
"display": {
29-
"provider": "Microsoft Addons",
30-
"resource": "supportPlanTypes",
31-
"operation": "Removes the Canonical support plan",
32-
"description": "Removes the specified Canonical support plan"
33-
}
34-
},
35-
{
36-
"name": "Microsoft.Addons/supportProviders/canonical/supportPlanTypes/get",
37-
"display": {
38-
"provider": "Microsoft Addons",
39-
"resource": "supportProviders",
40-
"operation": "Gets available Canonical support plan types.",
41-
"description": "Gets the available Canonical support plan types as well as some extra metadata on their enabled status."
42-
}
43-
},
44-
{
45-
"name": "Microsoft.Addons/register/action",
46-
"display": {
47-
"provider": "Microsoft Addons",
48-
"resource": "register",
49-
"operation": "Register for Microsoft.Addons",
50-
"description": "Register the specified subscription with Microsoft.Addons"
51-
}
52-
}
53-
]
54+
]
55+
}
5456
}
5557
}
5658
}

0 commit comments

Comments
 (0)