Skip to content

Commit cf64843

Browse files
authored
Merge pull request #2242 from microsoft/feat/recursive-reference
feat/recursive reference
2 parents a13a18b + 008d5ba commit cf64843

24 files changed

+259
-67
lines changed

src/Microsoft.OpenApi/Interfaces/IOpenApiReferenceHolder.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ public interface IOpenApiReferenceHolder<out T, V> : IOpenApiReferenceHolder whe
1515
/// <summary>
1616
/// Gets the resolved target object.
1717
/// </summary>
18-
T Target { get; }
18+
V Target { get; }
19+
/// <summary>
20+
/// Gets the recursively resolved target object.
21+
/// </summary>
22+
T RecursiveTarget { get; }
1923
/// <summary>
2024
/// Copy the reference as a target element with overrides.
2125
/// </summary>

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiCallback.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
99
/// Defines the base properties for the callback object.
1010
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
1111
/// </summary>
12-
public interface IOpenApiCallback : IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiCallback>
12+
public interface IOpenApiCallback : IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiCallback>, IOpenApiReferenceable
1313
{
1414
/// <summary>
1515
/// A Path Item Object used to define a callback request and expected responses.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
77
/// Defines the base properties for the example object.
88
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
99
/// </summary>
10-
public interface IOpenApiExample : IOpenApiDescribedElement, IOpenApiSummarizedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiExample>
10+
public interface IOpenApiExample : IOpenApiDescribedElement, IOpenApiSummarizedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiExample>, IOpenApiReferenceable
1111
{
1212
/// <summary>
1313
/// Embedded literal example. The value field and externalValue field are mutually

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiHeader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
99
/// Defines the base properties for the headers object.
1010
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
1111
/// </summary>
12-
public interface IOpenApiHeader : IOpenApiDescribedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiHeader>
12+
public interface IOpenApiHeader : IOpenApiDescribedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiHeader>, IOpenApiReferenceable
1313
{
1414
/// <summary>
1515
/// Determines whether this header is mandatory.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiLink.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
77
/// Defines the base properties for the link object.
88
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
99
/// </summary>
10-
public interface IOpenApiLink : IOpenApiDescribedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiLink>
10+
public interface IOpenApiLink : IOpenApiDescribedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiLink>, IOpenApiReferenceable
1111
{
1212
/// <summary>
1313
/// A relative or absolute reference to an OAS operation.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiParameter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
88
/// Defines the base properties for the parameter object.
99
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
1010
/// </summary>
11-
public interface IOpenApiParameter : IOpenApiDescribedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiParameter>
11+
public interface IOpenApiParameter : IOpenApiDescribedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiParameter>, IOpenApiReferenceable
1212
{
1313
/// <summary>
1414
/// REQUIRED. The name of the parameter. Parameter names are case sensitive.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiPathItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
88
/// Defines the base properties for the path item object.
99
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
1010
/// </summary>
11-
public interface IOpenApiPathItem : IOpenApiDescribedElement, IOpenApiSummarizedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiPathItem>
11+
public interface IOpenApiPathItem : IOpenApiDescribedElement, IOpenApiSummarizedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiPathItem>, IOpenApiReferenceable
1212
{
1313
/// <summary>
1414
/// Gets the definition of operations on this path.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiRequestBody.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
88
/// Defines the base properties for the request body object.
99
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
1010
/// </summary>
11-
public interface IOpenApiRequestBody : IOpenApiDescribedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiRequestBody>
11+
public interface IOpenApiRequestBody : IOpenApiDescribedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiRequestBody>, IOpenApiReferenceable
1212
{
1313
/// <summary>
1414
/// Determines if the request body is required in the request. Defaults to false.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
77
/// Defines the base properties for the response object.
88
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
99
/// </summary>
10-
public interface IOpenApiResponse : IOpenApiDescribedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiResponse>
10+
public interface IOpenApiResponse : IOpenApiDescribedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiResponse>, IOpenApiReferenceable
1111
{
1212
/// <summary>
1313
/// Maps a header name to its definition.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiSchema.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.OpenApi.Models.Interfaces;
99
/// Defines the base properties for the schema object.
1010
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.
1111
/// </summary>
12-
public interface IOpenApiSchema : IOpenApiDescribedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiSchema>
12+
public interface IOpenApiSchema : IOpenApiDescribedElement, IOpenApiReadOnlyExtensible, IShallowCopyable<IOpenApiSchema>, IOpenApiReferenceable
1313
{
1414

1515
/// <summary>

0 commit comments

Comments
 (0)