From 194576e7e3df29fb387b51fd51aa4c9bd33d99ae Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Thu, 10 Mar 2022 22:37:35 +0300 Subject: [PATCH 1/9] Fix exception thrown when OpenSpecVersion is null --- src/Microsoft.OpenApi.Hidi/OpenApiService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs index ba8b84e0e..357152343 100644 --- a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs +++ b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. using System; @@ -113,7 +113,7 @@ CancellationToken cancellationToken } openApiFormat = format ?? GetOpenApiFormat(openapi, logger); - openApiVersion = version == null ? TryParseOpenApiSpecVersion(version) : result.OpenApiDiagnostic.SpecificationVersion; + openApiVersion = version == null ? result.OpenApiDiagnostic.SpecificationVersion : TryParseOpenApiSpecVersion(version); } Func predicate; From af25fe44d1bcffc8a6e544d8d9c30017a0de3cc5 Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Thu, 10 Mar 2022 22:38:24 +0300 Subject: [PATCH 2/9] Add recursive solution for nested collection item object --- src/Microsoft.OpenApi.Hidi/OpenApiService.cs | 41 ++++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs index 357152343..129dfa54b 100644 --- a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs +++ b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. using System; @@ -301,24 +301,41 @@ public static Dictionary> ParseJsonCollectionFile(Stream st logger.LogTrace("Parsing the json collection file into a JsonDocument"); using var document = JsonDocument.Parse(stream); var root = document.RootElement; - var itemElement = root.GetProperty("item"); - foreach (var requestObject in itemElement.EnumerateArray().Select(item => item.GetProperty("request"))) - { - // Fetch list of methods and urls from collection, store them in a dictionary - var path = requestObject.GetProperty("url").GetProperty("raw").ToString(); - var method = requestObject.GetProperty("method").ToString(); - if (!requestUrls.ContainsKey(path)) + requestUrls = Enumerate(root, requestUrls); + + logger.LogTrace("Finished fetching the list of paths and Http methods defined in the Postman collection."); + return requestUrls; + } + + private static Dictionary> Enumerate(JsonElement itemElement, Dictionary> paths) + { + var itemsArray = itemElement.GetProperty("item"); + + foreach (var item in itemsArray.EnumerateArray()) + { + if (item.TryGetProperty("request", out var request)) { - requestUrls.Add(path, new List { method }); + // Fetch list of methods and urls from collection, store them in a dictionary + var path = request.GetProperty("url").GetProperty("raw").ToString(); + var method = request.GetProperty("method").ToString(); + + if (!paths.ContainsKey(path)) + { + paths.Add(path, new List { method }); + } + else + { + paths[path].Add(method); + } } else { - requestUrls[path].Add(method); + Enumerate(item, paths); } } - logger.LogTrace("Finished fetching the list of paths and Http methods defined in the Postman collection."); - return requestUrls; + + return paths; } internal static async Task ValidateOpenApiDocument(string openapi, LogLevel loglevel, CancellationToken cancellationToken) From bc87d1ef003040168fb104c1344886df6aa5ebbc Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Thu, 10 Mar 2022 23:23:15 +0300 Subject: [PATCH 3/9] Code refactoring --- src/Microsoft.OpenApi.Hidi/OpenApiService.cs | 32 ++++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs index 129dfa54b..eebc5b5dd 100644 --- a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs +++ b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs @@ -314,20 +314,26 @@ private static Dictionary> Enumerate(JsonElement itemElemen foreach (var item in itemsArray.EnumerateArray()) { - if (item.TryGetProperty("request", out var request)) + if(item.ValueKind == JsonValueKind.Object) { - // Fetch list of methods and urls from collection, store them in a dictionary - var path = request.GetProperty("url").GetProperty("raw").ToString(); - var method = request.GetProperty("method").ToString(); - - if (!paths.ContainsKey(path)) - { - paths.Add(path, new List { method }); - } - else - { - paths[path].Add(method); - } + if(item.TryGetProperty("request", out var request)) + { + // Fetch list of methods and urls from collection, store them in a dictionary + var path = request.GetProperty("url").GetProperty("raw").ToString(); + var method = request.GetProperty("method").ToString(); + if (!paths.ContainsKey(path)) + { + paths.Add(path, new List { method }); + } + else + { + paths[path].Add(method); + } + } + else + { + Enumerate(item, paths); + } } else { From c666c4ae4b1034b73ef602152bbcb87263bd2099 Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Thu, 10 Mar 2022 23:23:51 +0300 Subject: [PATCH 4/9] Add nested sample collection file and copy it to output directory --- .../Microsoft.OpenApi.Tests.csproj | 3 + .../UtilityFiles/postmanCollection_ver3.json | 1382 +++++++++++++++++ 2 files changed, 1385 insertions(+) create mode 100644 test/Microsoft.OpenApi.Tests/UtilityFiles/postmanCollection_ver3.json diff --git a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj index 360eeea92..eea157d2e 100644 --- a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj +++ b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj @@ -44,6 +44,9 @@ Always + + Always + Always diff --git a/test/Microsoft.OpenApi.Tests/UtilityFiles/postmanCollection_ver3.json b/test/Microsoft.OpenApi.Tests/UtilityFiles/postmanCollection_ver3.json new file mode 100644 index 000000000..2c7637ed7 --- /dev/null +++ b/test/Microsoft.OpenApi.Tests/UtilityFiles/postmanCollection_ver3.json @@ -0,0 +1,1382 @@ +{ + "info": { + "_postman_id": "6281bdba-62b8-2276-a5d6-268e87f48c89", + "name": "Graph-Collection", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "admin", + "item": [ + { + "name": "/admin", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin" + ] + } + } + }, + { + "name": "/admin", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}", + "issues" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}", + "issues" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues/{serviceHealthIssue-id}", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues/{serviceHealthIssue-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}", + "issues", + "{serviceHealthIssue-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues/{serviceHealthIssue-id}", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues/{serviceHealthIssue-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}", + "issues", + "{serviceHealthIssue-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues/{serviceHealthIssue-id}", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues/{serviceHealthIssue-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}", + "issues", + "{serviceHealthIssue-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues/{serviceHealthIssue-id}/microsoft.graph.incidentReport()", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issues/{serviceHealthIssue-id}/microsoft.graph.incidentReport()", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "healthOverviews", + "{serviceHealth-id}", + "issues", + "{serviceHealthIssue-id}", + "microsoft.graph.incidentReport()" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/issues", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "issues" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/issues", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "issues" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/issues/{serviceHealthIssue-id}", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues/{serviceHealthIssue-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "issues", + "{serviceHealthIssue-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/issues/{serviceHealthIssue-id}", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues/{serviceHealthIssue-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "issues", + "{serviceHealthIssue-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/issues/{serviceHealthIssue-id}", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues/{serviceHealthIssue-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "issues", + "{serviceHealthIssue-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/issues/{serviceHealthIssue-id}/microsoft.graph.incidentReport()", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues/{serviceHealthIssue-id}/microsoft.graph.incidentReport()", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "issues", + "{serviceHealthIssue-id}", + "microsoft.graph.incidentReport()" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/microsoft.graph.archive", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/microsoft.graph.archive", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "microsoft.graph.archive" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/microsoft.graph.favorite", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/microsoft.graph.favorite", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "microsoft.graph.favorite" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/microsoft.graph.markRead", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/microsoft.graph.markRead", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "microsoft.graph.markRead" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/microsoft.graph.markUnread", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/microsoft.graph.markUnread", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "microsoft.graph.markUnread" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/microsoft.graph.unarchive", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/microsoft.graph.unarchive", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "microsoft.graph.unarchive" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/microsoft.graph.unfavorite", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/microsoft.graph.unfavorite", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "microsoft.graph.unfavorite" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachments" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachments" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachments", + "{serviceAnnouncementAttachment-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachments", + "{serviceAnnouncementAttachment-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachments", + "{serviceAnnouncementAttachment-id}" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}/content", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}/content", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachments", + "{serviceAnnouncementAttachment-id}", + "content" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}/content", + "request": { + "method": "PUT", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachments/{serviceAnnouncementAttachment-id}/content", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachments", + "{serviceAnnouncementAttachment-id}", + "content" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachmentsArchive", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachmentsArchive", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachmentsArchive" + ] + } + } + }, + { + "name": "/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachmentsArchive", + "request": { + "method": "PUT", + "url": { + "raw": "https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/messages/{serviceUpdateMessage-id}/attachmentsArchive", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "admin", + "serviceAnnouncement", + "messages", + "{serviceUpdateMessage-id}", + "attachmentsArchive" + ] + } + } + } + ] + }, + { + "name": "agreementAcceptances", + "item": [ + { + "name": "/agreementAcceptances", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/agreementAcceptances", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "agreementAcceptances" + ] + } + } + }, + { + "name": "/agreementAcceptances", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/agreementAcceptances", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "agreementAcceptances" + ] + } + } + }, + { + "name": "/agreementAcceptances/{agreementAcceptance-id}", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/agreementAcceptances/{agreementAcceptance-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "agreementAcceptances", + "{agreementAcceptance-id}" + ] + } + } + }, + { + "name": "/agreementAcceptances/{agreementAcceptance-id}", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/agreementAcceptances/{agreementAcceptance-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "agreementAcceptances", + "{agreementAcceptance-id}" + ] + } + } + }, + { + "name": "/agreementAcceptances/{agreementAcceptance-id}", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/agreementAcceptances/{agreementAcceptance-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "agreementAcceptances", + "{agreementAcceptance-id}" + ] + } + } + } + ] + }, + { + "name": "appCatalogs", + "item": [ + { + "name": "/appCatalogs", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs" + ] + } + } + }, + { + "name": "/appCatalogs", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}", + "appDefinitions" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}", + "appDefinitions" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}", + "appDefinitions", + "{teamsAppDefinition-id}" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}", + "appDefinitions", + "{teamsAppDefinition-id}" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}", + "appDefinitions", + "{teamsAppDefinition-id}" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}/bot", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}/bot", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}", + "appDefinitions", + "{teamsAppDefinition-id}", + "bot" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}/bot", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}/bot", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}", + "appDefinitions", + "{teamsAppDefinition-id}", + "bot" + ] + } + } + }, + { + "name": "/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}/bot", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsApp-id}/appDefinitions/{teamsAppDefinition-id}/bot", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs", + "teamsApps", + "{teamsApp-id}", + "appDefinitions", + "{teamsAppDefinition-id}", + "bot" + ] + } + } + } + ] + } + ] +} \ No newline at end of file From 2a8996d414e3f546c5c885441174dc1a6b223e4f Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Thu, 10 Mar 2022 23:24:01 +0300 Subject: [PATCH 5/9] Add unit test --- .../Services/OpenApiFilterServiceTests.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/Microsoft.OpenApi.Tests/Services/OpenApiFilterServiceTests.cs b/test/Microsoft.OpenApi.Tests/Services/OpenApiFilterServiceTests.cs index 78f8ec048..28c259fc6 100644 --- a/test/Microsoft.OpenApi.Tests/Services/OpenApiFilterServiceTests.cs +++ b/test/Microsoft.OpenApi.Tests/Services/OpenApiFilterServiceTests.cs @@ -69,6 +69,23 @@ public void ReturnFilteredOpenApiDocumentBasedOnPostmanCollection() Assert.Equal(3, subsetOpenApiDocument.Paths.Count); } + [Fact] + public void ShouldParseNestedPostmanCollection() + { + // Arrange + var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles\\postmanCollection_ver3.json"); + var fileInput = new FileInfo(filePath); + var stream = fileInput.OpenRead(); + + // Act + var requestUrls = OpenApiService.ParseJsonCollectionFile(stream, _logger); + var pathCount = requestUrls.Count; + + // Assert + Assert.NotNull(requestUrls); + Assert.Equal(30, pathCount); + } + [Fact] public void ThrowsExceptionWhenUrlsInCollectionAreMissingFromSourceDocument() { From 3350d86bab72a22bd84372ea2ccfbe82a2575f7d Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Mon, 14 Mar 2022 09:37:54 +0300 Subject: [PATCH 6/9] Rename method --- src/Microsoft.OpenApi.Hidi/OpenApiService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs index eebc5b5dd..d68daea80 100644 --- a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs +++ b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs @@ -302,13 +302,13 @@ public static Dictionary> ParseJsonCollectionFile(Stream st using var document = JsonDocument.Parse(stream); var root = document.RootElement; - requestUrls = Enumerate(root, requestUrls); - + requestUrls = EnumerateJsonDocument(root, requestUrls); logger.LogTrace("Finished fetching the list of paths and Http methods defined in the Postman collection."); + return requestUrls; } - private static Dictionary> Enumerate(JsonElement itemElement, Dictionary> paths) + private static Dictionary> EnumerateJsonDocument(JsonElement itemElement, Dictionary> paths) { var itemsArray = itemElement.GetProperty("item"); @@ -332,12 +332,12 @@ private static Dictionary> Enumerate(JsonElement itemElemen } else { - Enumerate(item, paths); + EnumerateJsonDocument(item, paths); } } else { - Enumerate(item, paths); + EnumerateJsonDocument(item, paths); } } From 3445c1d3199ebd8dc598d8d08a05f27904b4faca Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Tue, 15 Mar 2022 11:32:05 +0300 Subject: [PATCH 7/9] Log warning to console if url in collection isn't in the input OpenApi doc and continue processing the rest of the urls and add unit test --- .../Services/OpenApiFilterService.cs | 1 + .../Microsoft.OpenApi.Tests.csproj | 3 + .../Services/OpenApiFilterServiceTests.cs | 22 +++ .../UtilityFiles/postmanCollection_ver4.json | 145 ++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 test/Microsoft.OpenApi.Tests/UtilityFiles/postmanCollection_ver4.json diff --git a/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs b/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs index 7b9111e4d..57c5fef09 100644 --- a/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs +++ b/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs @@ -81,6 +81,7 @@ public static class OpenApiFilterService var openApiOperations = GetOpenApiOperations(rootNode, url, apiVersion); if (openApiOperations == null) { + Console.WriteLine($"The url {url} could not be found in the OpenApi description"); continue; } diff --git a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj index eea157d2e..a187a2887 100644 --- a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj +++ b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj @@ -47,6 +47,9 @@ Always + + Always + Always diff --git a/test/Microsoft.OpenApi.Tests/Services/OpenApiFilterServiceTests.cs b/test/Microsoft.OpenApi.Tests/Services/OpenApiFilterServiceTests.cs index 28c259fc6..29cb684d2 100644 --- a/test/Microsoft.OpenApi.Tests/Services/OpenApiFilterServiceTests.cs +++ b/test/Microsoft.OpenApi.Tests/Services/OpenApiFilterServiceTests.cs @@ -103,6 +103,28 @@ public void ThrowsExceptionWhenUrlsInCollectionAreMissingFromSourceDocument() Assert.Equal("The urls in the Postman collection supplied could not be found.", message); } + [Fact] + public void ContinueProcessingWhenUrlsInCollectionAreMissingFromSourceDocument() + { + // Arrange + var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles\\postmanCollection_ver4.json"); + var fileInput = new FileInfo(filePath); + var stream = fileInput.OpenRead(); + + // Act + var requestUrls = OpenApiService.ParseJsonCollectionFile(stream, _logger); + var pathCount = requestUrls.Count; + var predicate = OpenApiFilterService.CreatePredicate(requestUrls: requestUrls, source: _openApiDocumentMock); + var subsetOpenApiDocument = OpenApiFilterService.CreateFilteredDocument(_openApiDocumentMock, predicate); + var subsetPathCount = subsetOpenApiDocument.Paths.Count; + + // Assert + Assert.NotNull(subsetOpenApiDocument); + Assert.NotEmpty(subsetOpenApiDocument.Paths); + Assert.Equal(2, subsetPathCount); + Assert.NotEqual(pathCount, subsetPathCount); + } + [Fact] public void ThrowsInvalidOperationExceptionInCreatePredicateWhenInvalidArgumentsArePassed() { diff --git a/test/Microsoft.OpenApi.Tests/UtilityFiles/postmanCollection_ver4.json b/test/Microsoft.OpenApi.Tests/UtilityFiles/postmanCollection_ver4.json new file mode 100644 index 000000000..edafeb0bd --- /dev/null +++ b/test/Microsoft.OpenApi.Tests/UtilityFiles/postmanCollection_ver4.json @@ -0,0 +1,145 @@ +{ + "info": { + "_postman_id": "43402ca3-f018-7c9b-2315-f176d9b171a3", + "name": "Graph-Collection", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "users-GET", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/users", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "users" + ] + } + } + }, + { + "name": "users-POST", + "request": { + "method": "POST", + "url": { + "raw": "https://graph.microsoft.com/v1.0/users", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "users" + ] + } + } + }, + { + "name": "/appCatalogs", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/appCatalogs", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "appCatalogs" + ] + } + } + }, + { + "name": "/agreementAcceptances", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/agreementAcceptances", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "agreementAcceptances" + ] + } + } + }, + { + "name": "{user-id}-GET", + "request": { + "method": "GET", + "url": { + "raw": "https://graph.microsoft.com/v1.0/users/{user-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "users", + "{user-id}" + ] + } + } + }, + { + "name": "{user-id}-PATCH", + "request": { + "method": "PATCH", + "url": { + "raw": "https://graph.microsoft.com/v1.0/users/{user-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "users", + "{user-id}" + ] + } + } + }, + { + "name": "{user-id}-DELETE", + "request": { + "method": "DELETE", + "url": { + "raw": "https://graph.microsoft.com/v1.0/users/{user-id}", + "protocol": "https", + "host": [ + "graph", + "microsoft", + "com" + ], + "path": [ + "v1.0", + "users", + "{user-id}" + ] + } + } + } + ] +} \ No newline at end of file From caa87da7a117071f0038d9b7bff780ee2e8d8ebd Mon Sep 17 00:00:00 2001 From: Darrel Miller Date: Sun, 27 Mar 2022 14:33:59 -0400 Subject: [PATCH 8/9] Fixed reporting collections with urls not in OpenAPI --- filteredGraph.yaml | 478 ++++++++++++++++++ .../Services/OpenApiFilterService.cs | 18 +- 2 files changed, 487 insertions(+), 9 deletions(-) create mode 100644 filteredGraph.yaml diff --git a/filteredGraph.yaml b/filteredGraph.yaml new file mode 100644 index 000000000..4dea96ea8 --- /dev/null +++ b/filteredGraph.yaml @@ -0,0 +1,478 @@ +openapi: 3.0.1 +info: + title: OData Service for namespace microsoft.graph - Subset + description: This OData service is located at https://graph.microsoft.com/v1.0 + version: 1.0.1 +servers: + - url: https://graph.microsoft.com/v1.0 +paths: + /admin/serviceAnnouncement: + get: + tags: + - admin.serviceAnnouncement + summary: Get serviceAnnouncement from admin + description: A container for service communications resources. Read-only. + operationId: admin.GetServiceAnnouncement + parameters: + - name: $select + in: query + description: Select properties to be returned + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - id + - healthOverviews + - issues + - messages + type: string + - name: $expand + in: query + description: Expand related entities + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - '*' + - healthOverviews + - issues + - messages + type: string + responses: + '200': + description: Retrieved navigation property + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.serviceAnnouncement' + links: + healthOverviews: + operationId: admin.ServiceAnnouncement.ListHealthOverviews + issues: + operationId: admin.ServiceAnnouncement.ListIssues + messages: + operationId: admin.ServiceAnnouncement.ListMessages + 4XX: + $ref: '#/components/responses/error' + 5XX: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + patch: + tags: + - admin.serviceAnnouncement + summary: Update the navigation property serviceAnnouncement in admin + operationId: admin.UpdateServiceAnnouncement + requestBody: + description: New navigation property values + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.serviceAnnouncement' + required: true + responses: + '204': + description: Success + 4XX: + $ref: '#/components/responses/error' + 5XX: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation +components: + schemas: + microsoft.graph.serviceAnnouncement: + allOf: + - $ref: '#/components/schemas/microsoft.graph.entity' + - title: serviceAnnouncement + type: object + properties: + healthOverviews: + type: array + items: + $ref: '#/components/schemas/microsoft.graph.serviceHealth' + description: 'A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly.' + issues: + type: array + items: + $ref: '#/components/schemas/microsoft.graph.serviceHealthIssue' + description: 'A collection of service issues for tenant. This property is a contained navigation property, it is nullable and readonly.' + messages: + type: array + items: + $ref: '#/components/schemas/microsoft.graph.serviceUpdateMessage' + description: 'A collection of service messages for tenant. This property is a contained navigation property, it is nullable and readonly.' + microsoft.graph.entity: + title: entity + type: object + properties: + id: + type: string + description: Read-only. + microsoft.graph.serviceHealth: + allOf: + - $ref: '#/components/schemas/microsoft.graph.entity' + - title: serviceHealth + type: object + properties: + service: + type: string + description: The service name. Use the list healthOverviews operation to get exact string names for services subscribed by the tenant. + status: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.serviceHealthStatus' + description: 'Show the overral service health status. Possible values are: serviceOperational, investigating, restoringService, verifyingService, serviceRestored, postIncidentReviewPublished, serviceDegradation, serviceInterruption, extendedRecovery, falsePositive, investigationSuspended, resolved, mitigatedExternal, mitigated, resolvedExternal, confirmed, reported, unknownFutureValue. For more details, see serviceHealthStatus values.' + issues: + type: array + items: + $ref: '#/components/schemas/microsoft.graph.serviceHealthIssue' + description: 'A collection of issues that happened on the service, with detailed information for each issue.' + microsoft.graph.serviceHealthIssue: + allOf: + - $ref: '#/components/schemas/microsoft.graph.serviceAnnouncementBase' + - title: serviceHealthIssue + type: object + properties: + classification: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.serviceHealthClassificationType' + description: 'The type of service health issue. Possible values are: advisory, incident, unknownFutureValue.' + feature: + type: string + description: The feature name of the service issue. + nullable: true + featureGroup: + type: string + description: The feature group name of the service issue. + nullable: true + impactDescription: + type: string + description: The description of the service issue impact. + isResolved: + type: boolean + description: Indicates whether the issue is resolved. + origin: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.serviceHealthOrigin' + description: 'Indicates the origin of the service issue. Possible values are: microsoft, thirdParty, customer, unknownFutureValue.' + posts: + type: array + items: + $ref: '#/components/schemas/microsoft.graph.serviceHealthIssuePost' + description: Collection of historical posts for the service issue. + service: + type: string + description: Indicates the service affected by the issue. + status: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.serviceHealthStatus' + description: 'The status of the service issue. Possible values are: serviceOperational, investigating, restoringService, verifyingService, serviceRestored, postIncidentReviewPublished, serviceDegradation, serviceInterruption, extendedRecovery, falsePositive, investigationSuspended, resolved, mitigatedExternal, mitigated, resolvedExternal, confirmed, reported, unknownFutureValue. See more in the table below.' + microsoft.graph.serviceUpdateMessage: + allOf: + - $ref: '#/components/schemas/microsoft.graph.serviceAnnouncementBase' + - title: serviceUpdateMessage + type: object + properties: + actionRequiredByDateTime: + pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' + type: string + description: The expected deadline of the action for the message. + format: date-time + nullable: true + attachmentsArchive: + type: string + description: The zip file that contains all attachments for a message. + format: base64url + nullable: true + body: + $ref: '#/components/schemas/microsoft.graph.itemBody' + category: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.serviceUpdateCategory' + description: 'The service message category. Possible values are: preventOrFixIssue, planForChange, stayInformed, unknownFutureValue.' + hasAttachments: + type: boolean + description: Indicates whether the message has any attachment. + isMajorChange: + type: boolean + description: Indicates whether the message describes a major update for the service. + nullable: true + services: + type: array + items: + type: string + nullable: true + description: The affected services by the service message. + severity: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.serviceUpdateSeverity' + description: 'The severity of the service message. Possible values are: normal, high, critical, unknownFutureValue.' + tags: + type: array + items: + type: string + nullable: true + description: 'A collection of tags for the service message. Tags are provided by the service team/support team who post the message to tell whether this message contains privacy data, or whether this message is for a service new feature update, and so on.' + viewPoint: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.serviceUpdateMessageViewpoint' + description: 'Represents user viewpoints data of the service message. This data includes message status such as whether the user has archived, read, or marked the message as favorite. This property is null when accessed with application permissions.' + nullable: true + attachments: + type: array + items: + $ref: '#/components/schemas/microsoft.graph.serviceAnnouncementAttachment' + description: A collection of serviceAnnouncementAttachments. + microsoft.graph.ODataErrors.ODataError: + required: + - error + type: object + properties: + error: + $ref: '#/components/schemas/microsoft.graph.ODataErrors.MainError' + microsoft.graph.serviceHealthStatus: + title: serviceHealthStatus + enum: + - serviceOperational + - investigating + - restoringService + - verifyingService + - serviceRestored + - postIncidentReviewPublished + - serviceDegradation + - serviceInterruption + - extendedRecovery + - falsePositive + - investigationSuspended + - resolved + - mitigatedExternal + - mitigated + - resolvedExternal + - confirmed + - reported + - unknownFutureValue + type: string + microsoft.graph.serviceAnnouncementBase: + allOf: + - $ref: '#/components/schemas/microsoft.graph.entity' + - title: serviceAnnouncementBase + type: object + properties: + details: + type: array + items: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.keyValuePair' + nullable: true + description: Additional details about service event. This property doesn't support filters. + endDateTime: + pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' + type: string + description: The end time of the service event. + format: date-time + nullable: true + lastModifiedDateTime: + pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' + type: string + description: The last modified time of the service event. + format: date-time + startDateTime: + pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' + type: string + description: The start time of the service event. + format: date-time + title: + type: string + description: The title of the service event. + microsoft.graph.serviceHealthClassificationType: + title: serviceHealthClassificationType + enum: + - advisory + - incident + - unknownFutureValue + type: string + microsoft.graph.serviceHealthOrigin: + title: serviceHealthOrigin + enum: + - microsoft + - thirdParty + - customer + - unknownFutureValue + type: string + microsoft.graph.serviceHealthIssuePost: + title: serviceHealthIssuePost + type: object + properties: + createdDateTime: + pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' + type: string + description: The published time of the post. + format: date-time + description: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.itemBody' + description: The content of the service issue post. + nullable: true + postType: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.postType' + description: 'The post type of the service issue historical post. Possible values are: regular, quick, strategic, unknownFutureValue.' + nullable: true + microsoft.graph.itemBody: + title: itemBody + type: object + properties: + content: + type: string + description: The content of the item. + nullable: true + contentType: + anyOf: + - $ref: '#/components/schemas/microsoft.graph.bodyType' + description: The type of the content. Possible values are text and html. + nullable: true + microsoft.graph.serviceUpdateCategory: + title: serviceUpdateCategory + enum: + - preventOrFixIssue + - planForChange + - stayInformed + - unknownFutureValue + type: string + microsoft.graph.serviceUpdateSeverity: + title: serviceUpdateSeverity + enum: + - normal + - high + - critical + - unknownFutureValue + type: string + microsoft.graph.serviceUpdateMessageViewpoint: + title: serviceUpdateMessageViewpoint + type: object + properties: + isArchived: + type: boolean + description: Indicates whether the user archived the message. + nullable: true + isFavorited: + type: boolean + description: Indicates whether the user marked the message as favorite. + nullable: true + isRead: + type: boolean + description: Indicates whether the user read the message. + nullable: true + microsoft.graph.serviceAnnouncementAttachment: + allOf: + - $ref: '#/components/schemas/microsoft.graph.entity' + - title: serviceAnnouncementAttachment + type: object + properties: + content: + type: string + description: The attachment content. + format: base64url + nullable: true + contentType: + type: string + nullable: true + lastModifiedDateTime: + pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' + type: string + format: date-time + nullable: true + name: + type: string + nullable: true + size: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + microsoft.graph.ODataErrors.MainError: + required: + - code + - message + type: object + properties: + code: + type: string + message: + type: string + target: + type: string + nullable: true + details: + type: array + items: + $ref: '#/components/schemas/microsoft.graph.ODataErrors.ErrorDetails' + innererror: + $ref: '#/components/schemas/microsoft.graph.ODataErrors.InnerError' + microsoft.graph.keyValuePair: + title: keyValuePair + type: object + properties: + name: + type: string + description: Name for this key-value pair + value: + type: string + description: Value for this key-value pair + nullable: true + microsoft.graph.postType: + title: postType + enum: + - regular + - quick + - strategic + - unknownFutureValue + type: string + microsoft.graph.bodyType: + title: bodyType + enum: + - text + - html + type: string + microsoft.graph.ODataErrors.ErrorDetails: + required: + - code + - message + type: object + properties: + code: + type: string + message: + type: string + target: + type: string + nullable: true + microsoft.graph.ODataErrors.InnerError: + title: InnerError + type: object + properties: + request-id: + type: string + description: Request Id as tracked internally by the service + nullable: true + client-request-id: + type: string + description: Client request Id as sent by the client application. + nullable: true + Date: + pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' + type: string + description: Date when the error occured. + format: date-time + nullable: true + responses: + error: + description: error + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.ODataErrors.ODataError' \ No newline at end of file diff --git a/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs b/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs index 57c5fef09..11dcaec14 100644 --- a/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs +++ b/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs @@ -73,24 +73,24 @@ public static class OpenApiFilterService var rootNode = CreateOpenApiUrlTreeNode(sources); // Iterate through urls dictionary and fetch operations for each url - foreach (var path in requestUrls) + foreach (var url in requestUrls) { var serverList = source.Servers; - var url = FormatUrlString(path.Key, serverList); + var path = ExtractPath(url.Key, serverList); - var openApiOperations = GetOpenApiOperations(rootNode, url, apiVersion); + var openApiOperations = GetOpenApiOperations(rootNode, path, apiVersion); if (openApiOperations == null) { - Console.WriteLine($"The url {url} could not be found in the OpenApi description"); + Console.WriteLine($"The url {url.Key} could not be found in the OpenApi description"); continue; } // Add the available ops if they are in the postman collection. See path.Value foreach (var ops in openApiOperations) { - if (path.Value.Contains(ops.Key.ToString().ToUpper())) + if (url.Value.Contains(ops.Key.ToString().ToUpper())) { - operationTypes.Add(ops.Key + url); + operationTypes.Add(ops.Key + path); } } } @@ -323,7 +323,7 @@ private static bool AddReferences(OpenApiComponents newComponents, OpenApiCompon return moreStuff; } - private static string FormatUrlString(string url, IList serverList) + private static string ExtractPath(string url, IList serverList) { var queryPath = string.Empty; foreach (var server in serverList) @@ -334,8 +334,8 @@ private static string FormatUrlString(string url, IList serverLis continue; } - var querySegments = url.Split(new[]{ serverUrl }, StringSplitOptions.None); - queryPath = querySegments[1]; + var urlComponents = url.Split(new[]{ serverUrl }, StringSplitOptions.None); + queryPath = urlComponents[1]; } return queryPath; From 53c56f7dc2cfa3824c738d9ca133a05c9ceb544e Mon Sep 17 00:00:00 2001 From: Darrel Miller Date: Sun, 27 Mar 2022 14:37:00 -0400 Subject: [PATCH 9/9] Removed openapi file that snook in. --- filteredGraph.yaml | 478 --------------------------------------------- 1 file changed, 478 deletions(-) delete mode 100644 filteredGraph.yaml diff --git a/filteredGraph.yaml b/filteredGraph.yaml deleted file mode 100644 index 4dea96ea8..000000000 --- a/filteredGraph.yaml +++ /dev/null @@ -1,478 +0,0 @@ -openapi: 3.0.1 -info: - title: OData Service for namespace microsoft.graph - Subset - description: This OData service is located at https://graph.microsoft.com/v1.0 - version: 1.0.1 -servers: - - url: https://graph.microsoft.com/v1.0 -paths: - /admin/serviceAnnouncement: - get: - tags: - - admin.serviceAnnouncement - summary: Get serviceAnnouncement from admin - description: A container for service communications resources. Read-only. - operationId: admin.GetServiceAnnouncement - parameters: - - name: $select - in: query - description: Select properties to be returned - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - id - - healthOverviews - - issues - - messages - type: string - - name: $expand - in: query - description: Expand related entities - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - '*' - - healthOverviews - - issues - - messages - type: string - responses: - '200': - description: Retrieved navigation property - content: - application/json: - schema: - $ref: '#/components/schemas/microsoft.graph.serviceAnnouncement' - links: - healthOverviews: - operationId: admin.ServiceAnnouncement.ListHealthOverviews - issues: - operationId: admin.ServiceAnnouncement.ListIssues - messages: - operationId: admin.ServiceAnnouncement.ListMessages - 4XX: - $ref: '#/components/responses/error' - 5XX: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - patch: - tags: - - admin.serviceAnnouncement - summary: Update the navigation property serviceAnnouncement in admin - operationId: admin.UpdateServiceAnnouncement - requestBody: - description: New navigation property values - content: - application/json: - schema: - $ref: '#/components/schemas/microsoft.graph.serviceAnnouncement' - required: true - responses: - '204': - description: Success - 4XX: - $ref: '#/components/responses/error' - 5XX: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation -components: - schemas: - microsoft.graph.serviceAnnouncement: - allOf: - - $ref: '#/components/schemas/microsoft.graph.entity' - - title: serviceAnnouncement - type: object - properties: - healthOverviews: - type: array - items: - $ref: '#/components/schemas/microsoft.graph.serviceHealth' - description: 'A collection of service health information for tenant. This property is a contained navigation property, it is nullable and readonly.' - issues: - type: array - items: - $ref: '#/components/schemas/microsoft.graph.serviceHealthIssue' - description: 'A collection of service issues for tenant. This property is a contained navigation property, it is nullable and readonly.' - messages: - type: array - items: - $ref: '#/components/schemas/microsoft.graph.serviceUpdateMessage' - description: 'A collection of service messages for tenant. This property is a contained navigation property, it is nullable and readonly.' - microsoft.graph.entity: - title: entity - type: object - properties: - id: - type: string - description: Read-only. - microsoft.graph.serviceHealth: - allOf: - - $ref: '#/components/schemas/microsoft.graph.entity' - - title: serviceHealth - type: object - properties: - service: - type: string - description: The service name. Use the list healthOverviews operation to get exact string names for services subscribed by the tenant. - status: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.serviceHealthStatus' - description: 'Show the overral service health status. Possible values are: serviceOperational, investigating, restoringService, verifyingService, serviceRestored, postIncidentReviewPublished, serviceDegradation, serviceInterruption, extendedRecovery, falsePositive, investigationSuspended, resolved, mitigatedExternal, mitigated, resolvedExternal, confirmed, reported, unknownFutureValue. For more details, see serviceHealthStatus values.' - issues: - type: array - items: - $ref: '#/components/schemas/microsoft.graph.serviceHealthIssue' - description: 'A collection of issues that happened on the service, with detailed information for each issue.' - microsoft.graph.serviceHealthIssue: - allOf: - - $ref: '#/components/schemas/microsoft.graph.serviceAnnouncementBase' - - title: serviceHealthIssue - type: object - properties: - classification: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.serviceHealthClassificationType' - description: 'The type of service health issue. Possible values are: advisory, incident, unknownFutureValue.' - feature: - type: string - description: The feature name of the service issue. - nullable: true - featureGroup: - type: string - description: The feature group name of the service issue. - nullable: true - impactDescription: - type: string - description: The description of the service issue impact. - isResolved: - type: boolean - description: Indicates whether the issue is resolved. - origin: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.serviceHealthOrigin' - description: 'Indicates the origin of the service issue. Possible values are: microsoft, thirdParty, customer, unknownFutureValue.' - posts: - type: array - items: - $ref: '#/components/schemas/microsoft.graph.serviceHealthIssuePost' - description: Collection of historical posts for the service issue. - service: - type: string - description: Indicates the service affected by the issue. - status: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.serviceHealthStatus' - description: 'The status of the service issue. Possible values are: serviceOperational, investigating, restoringService, verifyingService, serviceRestored, postIncidentReviewPublished, serviceDegradation, serviceInterruption, extendedRecovery, falsePositive, investigationSuspended, resolved, mitigatedExternal, mitigated, resolvedExternal, confirmed, reported, unknownFutureValue. See more in the table below.' - microsoft.graph.serviceUpdateMessage: - allOf: - - $ref: '#/components/schemas/microsoft.graph.serviceAnnouncementBase' - - title: serviceUpdateMessage - type: object - properties: - actionRequiredByDateTime: - pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' - type: string - description: The expected deadline of the action for the message. - format: date-time - nullable: true - attachmentsArchive: - type: string - description: The zip file that contains all attachments for a message. - format: base64url - nullable: true - body: - $ref: '#/components/schemas/microsoft.graph.itemBody' - category: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.serviceUpdateCategory' - description: 'The service message category. Possible values are: preventOrFixIssue, planForChange, stayInformed, unknownFutureValue.' - hasAttachments: - type: boolean - description: Indicates whether the message has any attachment. - isMajorChange: - type: boolean - description: Indicates whether the message describes a major update for the service. - nullable: true - services: - type: array - items: - type: string - nullable: true - description: The affected services by the service message. - severity: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.serviceUpdateSeverity' - description: 'The severity of the service message. Possible values are: normal, high, critical, unknownFutureValue.' - tags: - type: array - items: - type: string - nullable: true - description: 'A collection of tags for the service message. Tags are provided by the service team/support team who post the message to tell whether this message contains privacy data, or whether this message is for a service new feature update, and so on.' - viewPoint: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.serviceUpdateMessageViewpoint' - description: 'Represents user viewpoints data of the service message. This data includes message status such as whether the user has archived, read, or marked the message as favorite. This property is null when accessed with application permissions.' - nullable: true - attachments: - type: array - items: - $ref: '#/components/schemas/microsoft.graph.serviceAnnouncementAttachment' - description: A collection of serviceAnnouncementAttachments. - microsoft.graph.ODataErrors.ODataError: - required: - - error - type: object - properties: - error: - $ref: '#/components/schemas/microsoft.graph.ODataErrors.MainError' - microsoft.graph.serviceHealthStatus: - title: serviceHealthStatus - enum: - - serviceOperational - - investigating - - restoringService - - verifyingService - - serviceRestored - - postIncidentReviewPublished - - serviceDegradation - - serviceInterruption - - extendedRecovery - - falsePositive - - investigationSuspended - - resolved - - mitigatedExternal - - mitigated - - resolvedExternal - - confirmed - - reported - - unknownFutureValue - type: string - microsoft.graph.serviceAnnouncementBase: - allOf: - - $ref: '#/components/schemas/microsoft.graph.entity' - - title: serviceAnnouncementBase - type: object - properties: - details: - type: array - items: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.keyValuePair' - nullable: true - description: Additional details about service event. This property doesn't support filters. - endDateTime: - pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' - type: string - description: The end time of the service event. - format: date-time - nullable: true - lastModifiedDateTime: - pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' - type: string - description: The last modified time of the service event. - format: date-time - startDateTime: - pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' - type: string - description: The start time of the service event. - format: date-time - title: - type: string - description: The title of the service event. - microsoft.graph.serviceHealthClassificationType: - title: serviceHealthClassificationType - enum: - - advisory - - incident - - unknownFutureValue - type: string - microsoft.graph.serviceHealthOrigin: - title: serviceHealthOrigin - enum: - - microsoft - - thirdParty - - customer - - unknownFutureValue - type: string - microsoft.graph.serviceHealthIssuePost: - title: serviceHealthIssuePost - type: object - properties: - createdDateTime: - pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' - type: string - description: The published time of the post. - format: date-time - description: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.itemBody' - description: The content of the service issue post. - nullable: true - postType: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.postType' - description: 'The post type of the service issue historical post. Possible values are: regular, quick, strategic, unknownFutureValue.' - nullable: true - microsoft.graph.itemBody: - title: itemBody - type: object - properties: - content: - type: string - description: The content of the item. - nullable: true - contentType: - anyOf: - - $ref: '#/components/schemas/microsoft.graph.bodyType' - description: The type of the content. Possible values are text and html. - nullable: true - microsoft.graph.serviceUpdateCategory: - title: serviceUpdateCategory - enum: - - preventOrFixIssue - - planForChange - - stayInformed - - unknownFutureValue - type: string - microsoft.graph.serviceUpdateSeverity: - title: serviceUpdateSeverity - enum: - - normal - - high - - critical - - unknownFutureValue - type: string - microsoft.graph.serviceUpdateMessageViewpoint: - title: serviceUpdateMessageViewpoint - type: object - properties: - isArchived: - type: boolean - description: Indicates whether the user archived the message. - nullable: true - isFavorited: - type: boolean - description: Indicates whether the user marked the message as favorite. - nullable: true - isRead: - type: boolean - description: Indicates whether the user read the message. - nullable: true - microsoft.graph.serviceAnnouncementAttachment: - allOf: - - $ref: '#/components/schemas/microsoft.graph.entity' - - title: serviceAnnouncementAttachment - type: object - properties: - content: - type: string - description: The attachment content. - format: base64url - nullable: true - contentType: - type: string - nullable: true - lastModifiedDateTime: - pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' - type: string - format: date-time - nullable: true - name: - type: string - nullable: true - size: - maximum: 2147483647 - minimum: -2147483648 - type: integer - format: int32 - microsoft.graph.ODataErrors.MainError: - required: - - code - - message - type: object - properties: - code: - type: string - message: - type: string - target: - type: string - nullable: true - details: - type: array - items: - $ref: '#/components/schemas/microsoft.graph.ODataErrors.ErrorDetails' - innererror: - $ref: '#/components/schemas/microsoft.graph.ODataErrors.InnerError' - microsoft.graph.keyValuePair: - title: keyValuePair - type: object - properties: - name: - type: string - description: Name for this key-value pair - value: - type: string - description: Value for this key-value pair - nullable: true - microsoft.graph.postType: - title: postType - enum: - - regular - - quick - - strategic - - unknownFutureValue - type: string - microsoft.graph.bodyType: - title: bodyType - enum: - - text - - html - type: string - microsoft.graph.ODataErrors.ErrorDetails: - required: - - code - - message - type: object - properties: - code: - type: string - message: - type: string - target: - type: string - nullable: true - microsoft.graph.ODataErrors.InnerError: - title: InnerError - type: object - properties: - request-id: - type: string - description: Request Id as tracked internally by the service - nullable: true - client-request-id: - type: string - description: Client request Id as sent by the client application. - nullable: true - Date: - pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' - type: string - description: Date when the error occured. - format: date-time - nullable: true - responses: - error: - description: error - content: - application/json: - schema: - $ref: '#/components/schemas/microsoft.graph.ODataErrors.ODataError' \ No newline at end of file