Skip to content

Commit 1511490

Browse files
Merge pull request #1146 from microsoft/mk/fix-validate-source-file-loading-error
Fix hidi validator error when loading unix paths
2 parents 2ab393f + 6f06ae4 commit 1511490

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private static async Task<ReadResult> ParseOpenApi(string openApiFile, bool inli
287287
{
288288
RuleSet = ValidationRuleSet.GetDefaultRuleSet(),
289289
LoadExternalRefs = inlineExternal,
290-
BaseUrl = openApiFile.StartsWith("http") ? new Uri(openApiFile) : new Uri("file:" + new FileInfo(openApiFile).DirectoryName + "\\")
290+
BaseUrl = openApiFile.StartsWith("http") ? new Uri(openApiFile) : new Uri("file:" + new FileInfo(openApiFile).DirectoryName + Path.DirectorySeparatorChar)
291291
}
292292
).ReadAsync(stream);
293293

test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiServiceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public async Task ReturnConvertedCSDLFile()
3838
}
3939

4040
[Theory]
41-
[InlineData("Todos.Todo.UpdateTodoById",null, 1)]
42-
[InlineData("Todos.Todo.ListTodo",null, 1)]
41+
[InlineData("Todos.Todo.UpdateTodo",null, 1)]
42+
[InlineData("Todos.Todo.ListTodo", null, 1)]
4343
[InlineData(null, "Todos.Todo", 4)]
4444
public async Task ReturnFilteredOpenApiDocBasedOnOperationIdsAndInputCsdlDocument(string operationIds, string tags, int expectedPathCount)
4545
{

0 commit comments

Comments
 (0)