@@ -254,7 +254,7 @@ private static async Task<OpenApiDocument> GetOpenApiAsync(HidiOptions options,
254
254
else if ( ! string . IsNullOrEmpty ( options . OpenApi ) )
255
255
{
256
256
stream = await GetStreamAsync ( options . OpenApi , logger , cancellationToken ) . ConfigureAwait ( false ) ;
257
- var result = await ParseOpenApiAsync ( options . OpenApi , format , options . InlineExternal , logger , stream , cancellationToken ) . ConfigureAwait ( false ) ;
257
+ var result = await ParseOpenApiAsync ( options . OpenApi , options . InlineExternal , logger , stream , cancellationToken ) . ConfigureAwait ( false ) ;
258
258
document = result . Document ;
259
259
}
260
260
else throw new InvalidOperationException ( "No input file path or URL provided" ) ;
@@ -351,8 +351,7 @@ private static MemoryStream ApplyFilterToCsdl(Stream csdlStream, string entitySe
351
351
try
352
352
{
353
353
using var stream = await GetStreamAsync ( openApi , logger , cancellationToken ) . ConfigureAwait ( false ) ;
354
- var openApiFormat = ! string . IsNullOrEmpty ( openApi ) ? GetOpenApiFormat ( openApi , logger ) : OpenApiFormat . Yaml ;
355
- result = await ParseOpenApiAsync ( openApi , openApiFormat . GetDisplayName ( ) , false , logger , stream , cancellationToken ) . ConfigureAwait ( false ) ;
354
+ result = await ParseOpenApiAsync ( openApi , false , logger , stream , cancellationToken ) . ConfigureAwait ( false ) ;
356
355
357
356
using ( logger . BeginScope ( "Calculating statistics" ) )
358
357
{
@@ -380,7 +379,7 @@ private static MemoryStream ApplyFilterToCsdl(Stream csdlStream, string entitySe
380
379
return result . Diagnostic . Errors . Count == 0 ;
381
380
}
382
381
383
- private static async Task < ReadResult > ParseOpenApiAsync ( string openApiFile , string format , bool inlineExternal , ILogger logger , Stream stream , CancellationToken cancellationToken = default )
382
+ private static async Task < ReadResult > ParseOpenApiAsync ( string openApiFile , bool inlineExternal , ILogger logger , Stream stream , CancellationToken cancellationToken = default )
384
383
{
385
384
ReadResult result ;
386
385
var stopwatch = Stopwatch . StartNew ( ) ;
@@ -396,7 +395,7 @@ private static async Task<ReadResult> ParseOpenApiAsync(string openApiFile, stri
396
395
new Uri ( "file://" + new FileInfo ( openApiFile ) . DirectoryName + Path . DirectorySeparatorChar )
397
396
} ;
398
397
399
- result = await OpenApiDocument . LoadAsync ( stream , format , settings , cancellationToken ) . ConfigureAwait ( false ) ;
398
+ result = await OpenApiDocument . LoadAsync ( stream , settings : settings , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ;
400
399
401
400
logger . LogTrace ( "{Timestamp}ms: Completed parsing." , stopwatch . ElapsedMilliseconds ) ;
402
401
0 commit comments