@@ -265,7 +265,7 @@ public static async Task ValidateOpenApiDocument(
265
265
{
266
266
throw new ArgumentNullException ( nameof ( openapi ) ) ;
267
267
}
268
- var stream = await GetStream ( openapi , logger , cancellationToken ) ;
268
+ using var stream = await GetStream ( openapi , logger , cancellationToken ) ;
269
269
270
270
OpenApiDocument document ;
271
271
Stopwatch stopwatch = Stopwatch . StartNew ( ) ;
@@ -546,7 +546,7 @@ internal static async Task ShowOpenApiDocument(string openapi, FileInfo output,
546
546
{
547
547
throw new ArgumentNullException ( nameof ( openapi ) ) ;
548
548
}
549
- var stream = await GetStream ( openapi , logger , cancellationToken ) ;
549
+ using var stream = await GetStream ( openapi , logger , cancellationToken ) ;
550
550
551
551
OpenApiDocument document ;
552
552
Stopwatch stopwatch = Stopwatch . StartNew ( ) ;
@@ -584,7 +584,6 @@ internal static async Task ShowOpenApiDocument(string openapi, FileInfo output,
584
584
using var file = new FileStream ( output . FullName , FileMode . Create ) ;
585
585
using var writer = new StreamWriter ( file ) ;
586
586
WriteTreeDocument ( openapi , document , writer ) ;
587
- writer . Flush ( ) ;
588
587
589
588
logger . LogTrace ( "Finished walking through the OpenApi document. " ) ;
590
589
}
0 commit comments