-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathIStreamLoader.cs
More file actions
25 lines (23 loc) · 934 Bytes
/
IStreamLoader.cs
File metadata and controls
25 lines (23 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.OpenApi.Models;
namespace Microsoft.OpenApi.Interfaces
{
/// <summary>
/// Interface for service that translates a URI into a stream that can be loaded by a Reader
/// </summary>
public interface IStreamLoader
{
/// <summary>
/// Use Uri to locate data and convert into an input object.
/// </summary>
/// <param name="uri">Identifier of some source of an OpenAPI Description</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A data object that can be processed by a reader to generate an <see cref="OpenApiDocument"/></returns>
Task<Stream> LoadAsync(Uri uri, CancellationToken cancellationToken = default);
}
}