Skip to content

Commit 9a2be7f

Browse files
committed
run operation asynchronously
1 parent 9389d79 commit 9a2be7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Microsoft.OpenApi.Readers/OpenApiYamlReader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

44
using System.IO;
@@ -47,15 +47,15 @@ public async Task<ReadResult> ReadAsync(TextReader input,
4747
/// <inheritdoc/>
4848
public async Task<ReadFragmentResult<T>> ReadFragmentAsync<T>(TextReader input,
4949
OpenApiSpecVersion version,
50-
OpenApiReaderSettings settings = null) where T : IOpenApiElement
50+
OpenApiReaderSettings settings = null,
5151
CancellationToken token = default) where T : IOpenApiElement
5252
{
5353
JsonNode jsonNode;
5454

5555
// Parse the YAML
5656
try
5757
{
58-
jsonNode = LoadJsonNodesFromYamlDocument(input);
58+
jsonNode = await Task.Run(() => LoadJsonNodesFromYamlDocument(input));
5959
}
6060
catch (JsonException ex)
6161
{

0 commit comments

Comments
 (0)