From 158f158c599ed7052640d266027d7e6ffa0e4f63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 20:28:18 +0000 Subject: [PATCH 1/2] Bump Microsoft.Graph from 5.55.0 to 6.8.0 --- updated-dependencies: - dependency-name: Microsoft.Graph dependency-version: 6.8.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- src/GitHubConnector.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHubConnector.csproj b/src/GitHubConnector.csproj index 329d4a4..e6f4516 100644 --- a/src/GitHubConnector.csproj +++ b/src/GitHubConnector.csproj @@ -30,7 +30,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From a8325da44083ec6ee1da9d7fff1fbd5f0e2d6ca9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Oct 2026 20:54:55 +0000 Subject: [PATCH 2/2] Fix Graph SDK result template serialization Co-authored-by: jasonjoh <8966342+jasonjoh@users.noreply.github.com> --- src/Services/SearchConnectorService.cs | 34 ++++++++++++++++++++------ 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/Services/SearchConnectorService.cs b/src/Services/SearchConnectorService.cs index e8f09b1..528f26e 100644 --- a/src/Services/SearchConnectorService.cs +++ b/src/Services/SearchConnectorService.cs @@ -7,6 +7,7 @@ using Microsoft.Graph; using Microsoft.Graph.External.Connections.Item.Items.Item.MicrosoftGraphExternalConnectorsAddActivities; using Microsoft.Graph.Models.ExternalConnectors; +using Microsoft.Kiota.Abstractions.Serialization; using Microsoft.Kiota.Authentication.Azure; namespace GitHubConnector.Services; @@ -149,10 +150,7 @@ public SearchConnectorService(AppSettings settings) { Id = itemType == "issues" ? "issueDisplay" : "repoDisplay", Priority = 1, - Layout = new() - { - AdditionalData = await GetResultTemplateAsync(resultCardJsonFile), - }, + Layout = await GetResultTemplateAsync(resultCardJsonFile), }, ], }, @@ -280,10 +278,32 @@ public Task GetIdentityForGitHubUserAsync(string? gitHubLogin) }); } - private static async Task> GetResultTemplateAsync(string resultCardJsonFile) + private static async Task GetResultTemplateAsync(string resultCardJsonFile) { var cardContents = await File.ReadAllTextAsync(resultCardJsonFile); - return JsonSerializer.Deserialize>(cardContents) ?? - throw new Exception($"Could not deserialize contents of {resultCardJsonFile}"); + using var cardJson = JsonDocument.Parse(cardContents); + return ToUntypedNode(cardJson.RootElement); + } + + private static UntypedNode ToUntypedNode(JsonElement element) + { + return element.ValueKind switch + { + JsonValueKind.Object => new UntypedObject(element.EnumerateObject() + .ToDictionary(property => property.Name, property => ToUntypedNode(property.Value))), + JsonValueKind.Array => new UntypedArray(element.EnumerateArray().Select(ToUntypedNode)), + JsonValueKind.String => new UntypedString(element.GetString()!), + JsonValueKind.Number => element.TryGetInt32(out var intValue) ? + new UntypedInteger(intValue) : + element.TryGetInt64(out var longValue) ? + new UntypedLong(longValue) : + element.TryGetDecimal(out var decimalValue) ? + new UntypedDecimal(decimalValue) : + new UntypedDouble(element.GetDouble()), + JsonValueKind.True => new UntypedBoolean(true), + JsonValueKind.False => new UntypedBoolean(false), + JsonValueKind.Null => new UntypedNull(), + _ => throw new JsonException($"Unsupported JSON value: {element.ValueKind}"), + }; } }