diff --git a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs index 64a23dff3..e63a2b9ba 100644 --- a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs +++ b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs @@ -225,7 +225,7 @@ private static XslCompiledTransform GetFilterTransform() private static Stream ApplyFilterToCsdl(Stream csdlStream, string entitySetOrSingleton, XslCompiledTransform transform) { Stream stream; - StreamReader inputReader = new(csdlStream); + using StreamReader inputReader = new(csdlStream, leaveOpen: true); XmlReader inputXmlReader = XmlReader.Create(inputReader); MemoryStream filteredStream = new(); StreamWriter writer = new(filteredStream);