Skip to content

Commit e18748f

Browse files
Align on backslashes
Co-authored-by: John L. Armstrong IV <[email protected]>
1 parent 7fa2f2c commit e18748f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public OpenApiUrlTreeNode Attach(string path,
155155
// Remove the last element, which is empty, and append the trailing slash to the new last element
156156
// This is to support URLs with trailing slashes
157157
Array.Resize(ref segments, segments.Length - 1);
158-
segments[segments.Length - 1] += "/";
158+
segments[segments.Length - 1] += @"\";
159159
}
160160

161161
return Attach(segments: segments,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ public async Task VerifyDiagramFromSampleOpenAPI()
470470
public static TheoryData<string, string[], string, string> SupportsTrailingSlashesInPathData => new TheoryData<string, string[], string, string>
471471
{
472472
// Path, children up to second to leaf, last expected leaf node name, expected leaf node path
473-
{ "/cars/{car-id}/build/", ["cars", "{car-id}"], "build/", @"\cars\{car-id}\build/" },
474-
{ "/cars/", [], "cars/", @"\cars/" },
473+
{ "/cars/{car-id}/build/", ["cars", "{car-id}"], @"build\", @"\cars\{car-id}\build\" },
474+
{ "/cars/", [], @"cars\", @"\cars\" },
475475
};
476476

477477
[Theory]

0 commit comments

Comments
 (0)