Skip to content

Commit 9895d74

Browse files
committed
- code linting
1 parent 6b91e9a commit 9895d74

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

src/Kiota.Builder/KiotaBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static string NormalizeApiManifestPath(Request request, string? baseUrl)
106106
true => await documentCachingProvider.GetDocumentAsync(new Uri(manifestPath), "manifests", "manifest.json", cancellationToken: cancellationToken).ConfigureAwait(false)
107107
};
108108
#pragma warning restore CA2000
109-
var manifest = manifestManagementService.DeserializeManifestDocument(manifestFileContent)
109+
var manifest = await manifestManagementService.DeserializeManifestDocumentAsync(manifestFileContent).ConfigureAwait(false)
110110
?? throw new InvalidOperationException("The manifest could not be decoded");
111111

112112
var apiDependency = (manifest.ApiDependencies.Count, string.IsNullOrEmpty(apiIdentifier)) switch
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.IO;
3-
using System.Text;
43
using System.Text.Json;
4+
using System.Threading.Tasks;
55
using Microsoft.OpenApi.ApiManifest;
66

77
namespace Kiota.Builder.Manifest;
@@ -15,21 +15,10 @@ public class ManifestManagementService
1515
/// </summary>
1616
/// <param name="jsonValue">The API manifest JSON representation</param>
1717
/// <returns>The deserialized manifest</returns>
18-
public ApiManifestDocument? DeserializeManifestDocument(string jsonValue)
19-
{
20-
ArgumentException.ThrowIfNullOrEmpty(jsonValue);
21-
var jsonDocument = JsonDocument.Parse(jsonValue);
22-
return ApiManifestDocument.Load(jsonDocument.RootElement);
23-
}
24-
/// <summary>
25-
/// Deserializes the API manifest document from a JSON representation.
26-
/// </summary>
27-
/// <param name="jsonValue">The API manifest JSON representation</param>
28-
/// <returns>The deserialized manifest</returns>
29-
public ApiManifestDocument? DeserializeManifestDocument(Stream jsonValue)
18+
public async Task<ApiManifestDocument?> DeserializeManifestDocumentAsync(Stream jsonValue)
3019
{
3120
ArgumentNullException.ThrowIfNull(jsonValue);
32-
var jsonDocument = await JsonDocument.ParseAsync(jsonValue);
21+
var jsonDocument = await JsonDocument.ParseAsync(jsonValue).ConfigureAwait(false);
3322
return ApiManifestDocument.Load(jsonDocument.RootElement);
3423
}
3524
}

0 commit comments

Comments
 (0)