Skip to content

Commit 485c45c

Browse files
committed
Add XML comments
1 parent f9fc28f commit 485c45c

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

src/Microsoft.OpenApi/Services/OpenApiReferenceResolver.cs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using Microsoft.OpenApi.Exceptions;
88
using Microsoft.OpenApi.Interfaces;
99
using Microsoft.OpenApi.Models;
10-
using Microsoft.OpenApi.Services;
1110

1211
namespace Microsoft.OpenApi.Services
1312
{
@@ -20,20 +19,24 @@ public class OpenApiReferenceResolver : OpenApiVisitorBase
2019
private bool _resolveRemoteReferences;
2120
private List<OpenApiError> _errors = new List<OpenApiError>();
2221

22+
/// <summary>
23+
/// Initializes the <see cref="OpenApiReferenceResolver"/> class.
24+
/// </summary>
2325
public OpenApiReferenceResolver(OpenApiDocument currentDocument, bool resolveRemoteReferences = true)
2426
{
2527
_currentDocument = currentDocument;
2628
_resolveRemoteReferences = resolveRemoteReferences;
2729
}
2830

29-
public IEnumerable<OpenApiError> Errors
30-
{
31-
get
32-
{
33-
return _errors;
34-
}
35-
}
31+
/// <summary>
32+
/// List of errors related to the OpenApiDocument
33+
/// </summary>
34+
public IEnumerable<OpenApiError> Errors => _errors;
3635

36+
/// <summary>
37+
/// Resolves tags in OpenApiDocument
38+
/// </summary>
39+
/// <param name="doc"></param>
3740
public override void Visit(OpenApiDocument doc)
3841
{
3942
if (doc.Tags != null)
@@ -42,13 +45,22 @@ public override void Visit(OpenApiDocument doc)
4245
}
4346
}
4447

48+
/// <summary>
49+
/// Visits the referenceable element in the host document
50+
/// </summary>
51+
/// <param name="referenceable">The referenceable element in the doc.</param>
4552
public override void Visit(IOpenApiReferenceable referenceable)
4653
{
4754
if (referenceable.Reference != null)
4855
{
4956
referenceable.Reference.HostDocument = _currentDocument;
5057
}
5158
}
59+
60+
/// <summary>
61+
/// Resolves references in components
62+
/// </summary>
63+
/// <param name="components"></param>
5264
public override void Visit(OpenApiComponents components)
5365
{
5466
ResolveMap(components.Parameters);
@@ -62,6 +74,10 @@ public override void Visit(OpenApiComponents components)
6274
ResolveMap(components.Headers);
6375
}
6476

77+
/// <summary>
78+
/// Resolves all references used in callbacks
79+
/// </summary>
80+
/// <param name="callbacks"></param>
6581
public override void Visit(IDictionary<string, OpenApiCallback> callbacks)
6682
{
6783
ResolveMap(callbacks);

0 commit comments

Comments
 (0)