-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathIOpenApiReferenceHolder.cs
More file actions
39 lines (36 loc) · 1.38 KB
/
IOpenApiReferenceHolder.cs
File metadata and controls
39 lines (36 loc) · 1.38 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.OpenApi.Models;
namespace Microsoft.OpenApi.Interfaces
{
/// <summary>
/// A generic interface for OpenApiReferenceable objects that have a target.
/// </summary>
/// <typeparam name="T">The type of the target being referenced</typeparam>
/// <typeparam name="V">The type of the interface implemented by both the target and the reference type</typeparam>
public interface IOpenApiReferenceHolder<out T, V> : IOpenApiReferenceHolder where T : IOpenApiReferenceable, V
{
/// <summary>
/// Gets the resolved target object.
/// </summary>
T Target { get; }
/// <summary>
/// Copy the reference as a target element with overrides.
/// </summary>
V CopyReferenceAsTargetElementWithOverrides(V source);
}
/// <summary>
/// A generic interface for OpenApiReferenceable objects that have a target.
/// </summary>
public interface IOpenApiReferenceHolder : IOpenApiSerializable
{
/// <summary>
/// Indicates if object is populated with data or is just a reference to the data
/// </summary>
bool UnresolvedReference { get; }
/// <summary>
/// Reference object.
/// </summary>
OpenApiReference Reference { get; init; }
}
}