Skip to content

Commit cd722e0

Browse files
committed
Code cleanup
1 parent c07809f commit cd722e0

File tree

5 files changed

+2
-31
lines changed

5 files changed

+2
-31
lines changed

src/Microsoft.OpenApi.Readers/Interface/IOpenApiVersionService.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ internal interface IOpenApiVersionService
3030
/// <returns>Instance of OpenAPIElement</returns>
3131
T LoadElement<T>(ParseNode node) where T : IOpenApiElement;
3232

33-
/// <summary>
34-
/// Function that converts a MapNode into a Tag object in a version specific way
35-
/// </summary>
36-
Func<MapNode, OpenApiTag> TagLoader { get; }
37-
3833
/// <summary>
3934
/// Converts a generic RootNode instance into a strongly typed OpenApiDocument
4035
/// </summary>

src/Microsoft.OpenApi.Readers/ParsingContext.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ internal OpenApiDocument Parse(YamlDocument yamlDocument, OpenApiDiagnostic diag
6868
/// Initiates the parsing process of a fragment. Not thread safe and should only be called once on a parsing context
6969
/// </summary>
7070
/// <param name="yamlDocument"></param>
71+
/// <param name="version">OpenAPI version of the fragment</param>
7172
/// <param name="diagnostic"></param>
7273
/// <returns>An OpenApiDocument populated based on the passed yamlDocument </returns>
7374
internal T ParseFragment<T>(YamlDocument yamlDocument, OpenApiSpecVersion version, OpenApiDiagnostic diagnostic) where T: IOpenApiElement
@@ -109,20 +110,6 @@ private static string GetVersion(RootNode rootNode)
109110
return versionNode?.GetScalarValue();
110111
}
111112

112-
private void ComputeTags(List<OpenApiTag> tags, Func<MapNode, OpenApiTag> loadTag)
113-
{
114-
// Precompute the tags array so that each tag reference does not require a new deserialization.
115-
var tagListPointer = new JsonPointer("#/tags");
116-
117-
var tagListNode = RootNode.Find(tagListPointer);
118-
119-
if (tagListNode != null && tagListNode is ListNode)
120-
{
121-
var tagListNodeAsListNode = (ListNode)tagListNode;
122-
tags.AddRange(tagListNodeAsListNode.CreateList(loadTag));
123-
}
124-
}
125-
126113
/// <summary>
127114
/// Service providing all Version specific conversion functions
128115
/// </summary>
@@ -135,7 +122,6 @@ internal IOpenApiVersionService VersionService
135122
set
136123
{
137124
_versionService = value;
138-
//ComputeTags(Tags, VersionService.TagLoader);
139125
}
140126
}
141127

src/Microsoft.OpenApi.Readers/V2/OpenApiV2VersionService.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ internal class OpenApiV2VersionService : IOpenApiVersionService
3939
[typeof(OpenApiXml)] = OpenApiV2Deserializer.LoadXml
4040
};
4141

42-
43-
/// <summary>
44-
/// Return a function that converts a MapNode into a V2 OpenApiTag
45-
/// </summary>
46-
public Func<MapNode, OpenApiTag> TagLoader => OpenApiV2Deserializer.LoadTag;
47-
4842
private static OpenApiReference ParseLocalReference(string localReference)
4943
{
5044
if (string.IsNullOrWhiteSpace(localReference))

src/Microsoft.OpenApi.Readers/V3/OpenApiV3VersionService.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ internal class OpenApiV3VersionService : IOpenApiVersionService
4949
[typeof(OpenApiXml)] = OpenApiV3Deserializer.LoadXml
5050
};
5151

52-
/// <summary>
53-
/// Return a function that converts a MapNode into a V3 OpenApiTag
54-
/// </summary>
55-
public Func<MapNode, OpenApiTag> TagLoader => OpenApiV3Deserializer.LoadTag;
56-
5752
/// <summary>
5853
/// Parse the string to a <see cref="OpenApiReference"/> object.
5954
/// </summary>

test/Microsoft.OpenApi.SmokeTests/ApiGurus.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public ApisGuruTests(ITestOutputHelper output)
2727

2828
static ApisGuruTests()
2929
{
30+
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
3031
_httpClient = new HttpClient(new HttpClientHandler()
3132
{
3233
AutomaticDecompression = DecompressionMethods.GZip

0 commit comments

Comments
 (0)