Skip to content

Commit

Permalink
Add stub test to support trailing slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
mderriey committed Mar 6, 2024
1 parent e65b484 commit ad775b2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/Microsoft.OpenApi.Tests/Services/OpenApiUrlTreeNodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,5 +466,23 @@ public async Task VerifyDiagramFromSampleOpenAPI()

await Verifier.Verify(diagram);
}

[Fact]
public void SupportsTrailingSlashesInPath()
{
var openApiDocument = new OpenApiDocument
{
Paths = new()
{
["/cars/{car-id}/build/"] = new()
}
};

var label1 = "trailing-slash";
var rootNode = OpenApiUrlTreeNode.Create(openApiDocument, label1);
var buildNode = rootNode.Children["cars"].Children["{car-id}"].Children["build"];

// Should buildNode have a path of "build/" or should it have a child with an empty string key?
}
}
}

0 comments on commit ad775b2

Please sign in to comment.