Skip to content

Commit ad775b2

Browse files
committed
Add stub test to support trailing slashes
1 parent e65b484 commit ad775b2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,5 +466,23 @@ public async Task VerifyDiagramFromSampleOpenAPI()
466466

467467
await Verifier.Verify(diagram);
468468
}
469+
470+
[Fact]
471+
public void SupportsTrailingSlashesInPath()
472+
{
473+
var openApiDocument = new OpenApiDocument
474+
{
475+
Paths = new()
476+
{
477+
["/cars/{car-id}/build/"] = new()
478+
}
479+
};
480+
481+
var label1 = "trailing-slash";
482+
var rootNode = OpenApiUrlTreeNode.Create(openApiDocument, label1);
483+
var buildNode = rootNode.Children["cars"].Children["{car-id}"].Children["build"];
484+
485+
// Should buildNode have a path of "build/" or should it have a child with an empty string key?
486+
}
469487
}
470488
}

0 commit comments

Comments
 (0)