Skip to content

Commit 5646dda

Browse files
thomasp98296Thomas Pham
andauthored
Fix a couple issues with existing swaggers (#19735)
* Change to lowercase for the TestNotificationDetailsResponse contract * Revert "Change to lowercase for the TestNotificationDetailsResponse contract" This reverts commit 5d12256. * Task 14946056: Fix the Swagger, need to return response schema for POST API even API does not have a response * Need to fix examples * Pretty check * State to state Co-authored-by: Thomas Pham <[email protected]>
1 parent 778b162 commit 5646dda

13 files changed

+803
-201
lines changed

package-lock.json

Lines changed: 202 additions & 140 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/monitor/resource-manager/Microsoft.Insights/stable/2022-04-01/actionGroups_API.json

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,20 @@
242242
],
243243
"responses": {
244244
"202": {
245-
"description": "The notification succeeded",
245+
"description": "The notification request accepted",
246246
"headers": {
247247
"location": {
248248
"type": "string",
249249
"description": "The location header that has the polling uri."
250250
}
251251
}
252252
},
253+
"200": {
254+
"description": "The notification succeeded",
255+
"schema": {
256+
"$ref": "#/definitions/TestNotificationDetailsResponse"
257+
}
258+
},
253259
"default": {
254260
"description": "An error occurred while sending the test notifications",
255261
"schema": {
@@ -294,14 +300,20 @@
294300
],
295301
"responses": {
296302
"202": {
297-
"description": "The notification succeeded",
303+
"description": "The notification request accepted",
298304
"headers": {
299305
"location": {
300306
"type": "string",
301307
"description": "The location header that has the polling uri."
302308
}
303309
}
304310
},
311+
"200": {
312+
"description": "The notification succeeded",
313+
"schema": {
314+
"$ref": "#/definitions/TestNotificationDetailsResponse"
315+
}
316+
},
305317
"default": {
306318
"description": "An error occurred while sending the test notifications",
307319
"schema": {
@@ -566,23 +578,23 @@
566578
"description": "The details of the test notification results.",
567579
"type": "object",
568580
"properties": {
569-
"Context": {
581+
"context": {
570582
"type": "object",
571583
"$ref": "#/definitions/Context"
572584
},
573-
"State": {
585+
"state": {
574586
"type": "string",
575587
"description": "The overall state"
576588
},
577-
"CompletedTime": {
589+
"completedTime": {
578590
"type": "string",
579591
"description": "The completed time"
580592
},
581-
"CreatedTime": {
593+
"createdTime": {
582594
"type": "string",
583595
"description": "The created time"
584596
},
585-
"ActionDetails": {
597+
"actionDetails": {
586598
"x-ms-identifiers": [],
587599
"type": "array",
588600
"items": {
@@ -592,7 +604,7 @@
592604
}
593605
},
594606
"required": [
595-
"State"
607+
"state"
596608
]
597609
},
598610
"ActionDetail": {
@@ -629,11 +641,11 @@
629641
"description": "The context info",
630642
"type": "object",
631643
"properties": {
632-
"NotificationSource": {
644+
"notificationSource": {
633645
"type": "string",
634646
"description": "The source of the notification request"
635647
},
636-
"ContextType": {
648+
"contextType": {
637649
"type": "string",
638650
"description": "The context id type"
639651
}

specification/monitor/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/getTestNotifications.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"200": {
99
"headers": {},
1010
"body": {
11-
"Context": {
12-
"NotificationSource": "Microsoft.Insights/TestNotification",
13-
"ContextType": "Microsoft.Insights/Budget"
11+
"context": {
12+
"notificationSource": "Microsoft.Insights/TestNotification",
13+
"contextType": "Microsoft.Insights/Budget"
1414
},
15-
"State": "Completed",
16-
"CompletedTime": "0001-01-01T00:00:00+00:00",
17-
"CreatedTime": "2021-09-21T04:52:29.5091168+00:00",
18-
"ActionDetails": [
15+
"state": "Completed",
16+
"completedTime": "0001-01-01T00:00:00+00:00",
17+
"createdTime": "2021-09-21T04:52:29.5091168+00:00",
18+
"actionDetails": [
1919
{
2020
"MechanismType": "AzureAppPush",
2121
"Name": "AzureAppPush-name",

specification/monitor/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/getTestNotificationsAtResourceGroupLevel.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"200": {
1010
"headers": {},
1111
"body": {
12-
"Context": {
13-
"NotificationSource": "Microsoft.Insights/TestNotification",
14-
"ContextType": "Microsoft.Insights/Budget"
12+
"context": {
13+
"notificationSource": "Microsoft.Insights/TestNotification",
14+
"contextType": "Microsoft.Insights/Budget"
1515
},
16-
"State": "Completed",
17-
"CompletedTime": "0001-01-01T00:00:00+00:00",
18-
"CreatedTime": "2021-09-21T04:52:29.5091168+00:00",
19-
"ActionDetails": [
16+
"state": "Completed",
17+
"completedTime": "0001-01-01T00:00:00+00:00",
18+
"createdTime": "2021-09-21T04:52:29.5091168+00:00",
19+
"actionDetails": [
2020
{
2121
"MechanismType": "AzureAppPush",
2222
"Name": "AzureAppPush-name",

specification/monitor/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/postTestNotifications.json

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,109 @@
120120
"responses": {
121121
"202": {
122122
"headers": {
123-
"location": "https://management.azure.com/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/Test-Rg/providers/microsoft.insights/notificationStatus/11111111111111?api-version=2021-09-01"
123+
"location": "https://management.azure.com/subscriptions/11111111-1111-1111-1111-111111111111/providers/microsoft.insights/notificationStatus/11111111111111?api-version=2022-04-01"
124+
}
125+
},
126+
"200": {
127+
"headers": {},
128+
"body": {
129+
"context": {
130+
"notificationSource": "Microsoft.Insights/TestNotification",
131+
"contextType": "Microsoft.Insights/Budget"
132+
},
133+
"state": "Completed",
134+
"completedTime": "0001-01-01T00:00:00+00:00",
135+
"createdTime": "2021-09-21T04:52:29.5091168+00:00",
136+
"actionDetails": [
137+
{
138+
"MechanismType": "AzureAppPush",
139+
"Name": "AzureAppPush-name",
140+
"Status": "Completed",
141+
"SubState": "Default",
142+
"SendTime": "2021-09-21T04:52:42.8620629+00:00",
143+
"Detail": null
144+
},
145+
{
146+
"MechanismType": "AzureFunction",
147+
"Name": "AzureFunction-name",
148+
"Status": "Completed",
149+
"SubState": "Default",
150+
"SendTime": "2021-09-21T04:52:42.0623319+00:00",
151+
"Detail": null
152+
},
153+
{
154+
"MechanismType": "Email",
155+
"Name": "Email-name",
156+
"Status": "Completed",
157+
"SubState": "Default",
158+
"SendTime": "2021-09-21T04:52:40.7480368+00:00",
159+
"Detail": null
160+
},
161+
{
162+
"MechanismType": "LogicApp",
163+
"Name": "LogicApp-Name",
164+
"Status": "Completed",
165+
"SubState": "Default",
166+
"SendTime": "2021-09-21T04:52:42.2473419+00:00",
167+
"Detail": null
168+
},
169+
{
170+
"MechanismType": "Webhook",
171+
"Name": "Webhook-name",
172+
"Status": "Completed",
173+
"SubState": "Default",
174+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
175+
"Detail": null
176+
},
177+
{
178+
"MechanismType": "SecureWebhook",
179+
"Name": "SecureWebhook-name",
180+
"Status": "Completed",
181+
"SubState": "Default",
182+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
183+
"Detail": null
184+
},
185+
{
186+
"MechanismType": "Sms",
187+
"Name": "Sms-name",
188+
"Status": "Completed",
189+
"SubState": "Default",
190+
"SendTime": "2021-09-21T04:52:41.353015+00:00",
191+
"Detail": null
192+
},
193+
{
194+
"MechanismType": "Voice",
195+
"Name": "Voice-name",
196+
"Status": "Completed",
197+
"SubState": "Default",
198+
"SendTime": "2021-09-21T04:52:41.6330734+00:00",
199+
"Detail": null
200+
},
201+
{
202+
"MechanismType": "EventHub",
203+
"Name": "EventHub-name",
204+
"Status": "Completed",
205+
"SubState": "Default",
206+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
207+
"Detail": null
208+
},
209+
{
210+
"MechanismType": "AutomationRunbook",
211+
"Name": "AutomationRunbook-name",
212+
"Status": "Completed",
213+
"SubState": "Default",
214+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
215+
"Detail": null
216+
},
217+
{
218+
"MechanismType": "Itsm",
219+
"Name": "Itsm-name",
220+
"Status": "Completed",
221+
"SubState": "Default",
222+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
223+
"Detail": null
224+
}
225+
]
124226
}
125227
}
126228
}

specification/monitor/resource-manager/Microsoft.Insights/stable/2022-04-01/examples/postTestNotificationsAtResourceGroupLevel.json

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,109 @@
121121
"responses": {
122122
"202": {
123123
"headers": {
124-
"location": "https://management.azure.com/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/Test-Rg/providers/microsoft.insights/notificationStatus/11111111111111?api-version=2021-09-01"
124+
"location": "https://management.azure.com/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/Test-Rg/providers/microsoft.insights/notificationStatus/11111111111111?api-version=2022-04-01"
125+
}
126+
},
127+
"200": {
128+
"headers": {},
129+
"body": {
130+
"context": {
131+
"notificationSource": "Microsoft.Insights/TestNotification",
132+
"contextType": "Microsoft.Insights/Budget"
133+
},
134+
"state": "Completed",
135+
"completedTime": "0001-01-01T00:00:00+00:00",
136+
"createdTime": "2021-09-21T04:52:29.5091168+00:00",
137+
"actionDetails": [
138+
{
139+
"MechanismType": "AzureAppPush",
140+
"Name": "AzureAppPush-name",
141+
"Status": "Completed",
142+
"SubState": "Default",
143+
"SendTime": "2021-09-21T04:52:42.8620629+00:00",
144+
"Detail": null
145+
},
146+
{
147+
"MechanismType": "AzureFunction",
148+
"Name": "AzureFunction-name",
149+
"Status": "Completed",
150+
"SubState": "Default",
151+
"SendTime": "2021-09-21T04:52:42.0623319+00:00",
152+
"Detail": null
153+
},
154+
{
155+
"MechanismType": "Email",
156+
"Name": "Email-name",
157+
"Status": "Completed",
158+
"SubState": "Default",
159+
"SendTime": "2021-09-21T04:52:40.7480368+00:00",
160+
"Detail": null
161+
},
162+
{
163+
"MechanismType": "LogicApp",
164+
"Name": "LogicApp-Name",
165+
"Status": "Completed",
166+
"SubState": "Default",
167+
"SendTime": "2021-09-21T04:52:42.2473419+00:00",
168+
"Detail": null
169+
},
170+
{
171+
"MechanismType": "Webhook",
172+
"Name": "Webhook-name",
173+
"Status": "Completed",
174+
"SubState": "Default",
175+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
176+
"Detail": null
177+
},
178+
{
179+
"MechanismType": "SecureWebhook",
180+
"Name": "SecureWebhook-name",
181+
"Status": "Completed",
182+
"SubState": "Default",
183+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
184+
"Detail": null
185+
},
186+
{
187+
"MechanismType": "Sms",
188+
"Name": "Sms-name",
189+
"Status": "Completed",
190+
"SubState": "Default",
191+
"SendTime": "2021-09-21T04:52:41.353015+00:00",
192+
"Detail": null
193+
},
194+
{
195+
"MechanismType": "Voice",
196+
"Name": "Voice-name",
197+
"Status": "Completed",
198+
"SubState": "Default",
199+
"SendTime": "2021-09-21T04:52:41.6330734+00:00",
200+
"Detail": null
201+
},
202+
{
203+
"MechanismType": "EventHub",
204+
"Name": "EventHub-name",
205+
"Status": "Completed",
206+
"SubState": "Default",
207+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
208+
"Detail": null
209+
},
210+
{
211+
"MechanismType": "AutomationRunbook",
212+
"Name": "AutomationRunbook-name",
213+
"Status": "Completed",
214+
"SubState": "Default",
215+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
216+
"Detail": null
217+
},
218+
{
219+
"MechanismType": "Itsm",
220+
"Name": "Itsm-name",
221+
"Status": "Completed",
222+
"SubState": "Default",
223+
"SendTime": "2021-09-21T04:52:42.0723479+00:00",
224+
"Detail": null
225+
}
226+
]
125227
}
126228
}
127229
}

0 commit comments

Comments
 (0)