Skip to content

Commit de1f796

Browse files
committed
Remove OData specific functions
1 parent 0cfb2ca commit de1f796

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ private OpenApiUrlTreeNode(string segment)
6363
/// <summary>
6464
/// Creates a structured directory of <see cref="OpenApiUrlTreeNode"/> nodes from the paths of an OpenAPI document.
6565
/// </summary>
66-
/// <param name="doc">The OpenAPI document.</param>
67-
/// <param name="label">Name tag for labelling the <see cref="OpenApiUrlTreeNode"/> nodes
66+
/// <param name="doc">Optional. The OpenAPI document.</param>
67+
/// <param name="label">Optional. Name tag for labelling the <see cref="OpenApiUrlTreeNode"/> nodes
6868
/// in the directory structure.</param>
6969
/// <returns>The root node of the created <see cref="OpenApiUrlTreeNode"/> directory structure.</returns>
70-
public static OpenApiUrlTreeNode Create(OpenApiDocument doc, string label = "")
70+
public static OpenApiUrlTreeNode Create(OpenApiDocument doc = null, string label = "")
7171
{
7272
OpenApiUrlTreeNode root = new OpenApiUrlTreeNode(string.Empty);
7373

@@ -144,7 +144,7 @@ private OpenApiUrlTreeNode Attach(IEnumerable<string> segments, OpenApiPathItem
144144
// If the child segment has already been defined, then insert into it
145145
if (Children.ContainsKey(segment))
146146
{
147-
return Children[segment].Attach(segments.Skip(1), pathItem, label, currentPath + "\\" + segment );
147+
return Children[segment].Attach(segments.Skip(1), pathItem, label, currentPath + "\\" + segment);
148148
}
149149
else
150150
{

test/Microsoft.OpenApi.Tests/Services/OpenApiUrlTreeNodeTests.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
using System.Collections.Generic;
5-
using Microsoft.OpenApi.Models;
6-
using Microsoft.OpenApi.Services;
7-
using Xunit;
8-
94
namespace Microsoft.OpenApi.Tests.Services
105
{
116
public class OpenApiUrlTreeNodeTests
127
{
138
[Fact]
14-
public void CreateEmptyUrlTreeNode()
9+
public void CreateUrlSpaceWithEmptyAndNullOpenApiDocument()
1510
{
1611
var doc = new OpenApiDocument() { };
1712

1813
var rootNode = OpenApiUrlTreeNode.Create(doc);
19-
var rootNode1 = OpenApiUrlTreeNode.Create(null);
14+
var rootNode1 = OpenApiUrlTreeNode.Create();
2015

2116
Assert.NotNull(rootNode);
2217
Assert.NotNull(rootNode1);

0 commit comments

Comments
 (0)