Skip to content

Commit a5c4d61

Browse files
authored
Merge pull request #2291 from microsoft/fix/hidi-yaml-fix-reference
fix: hidi fails to parse yaml files when fixing references
2 parents 5059a7f + c5b69fe commit a5c4d61

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,10 @@ private static async Task<ReadResult> ParseOpenApiAsync(string openApiFile, bool
438438
var sb = new StringBuilder();
439439
document.SerializeAsV3(new OpenApiYamlWriter(new StringWriter(sb)));
440440

441-
var doc = OpenApiDocument.Parse(sb.ToString(), format).Document;
441+
var settings = new OpenApiReaderSettings();
442+
settings.AddYamlReader();
443+
444+
var doc = OpenApiDocument.Parse(sb.ToString(), format, settings).Document;
442445

443446
return doc;
444447
}

0 commit comments

Comments
 (0)