Skip to content

Commit 3f46ebf

Browse files
committed
Remove unnecessary format param; clean up extra semi-colon
1 parent bd9f810 commit 3f46ebf

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private static async Task<OpenApiDocument> GetOpenApiAsync(HidiOptions options,
254254
else if (!string.IsNullOrEmpty(options.OpenApi))
255255
{
256256
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);
258258
document = result.Document;
259259
}
260260
else throw new InvalidOperationException("No input file path or URL provided");
@@ -351,8 +351,7 @@ private static MemoryStream ApplyFilterToCsdl(Stream csdlStream, string entitySe
351351
try
352352
{
353353
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);
356355

357356
using (logger.BeginScope("Calculating statistics"))
358357
{
@@ -380,7 +379,7 @@ private static MemoryStream ApplyFilterToCsdl(Stream csdlStream, string entitySe
380379
return result.Diagnostic.Errors.Count == 0;
381380
}
382381

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)
384383
{
385384
ReadResult result;
386385
var stopwatch = Stopwatch.StartNew();
@@ -396,7 +395,7 @@ private static async Task<ReadResult> ParseOpenApiAsync(string openApiFile, stri
396395
new Uri("file://" + new FileInfo(openApiFile).DirectoryName + Path.DirectorySeparatorChar)
397396
};
398397

399-
result = await OpenApiDocument.LoadAsync(stream, format, settings, cancellationToken).ConfigureAwait(false);
398+
result = await OpenApiDocument.LoadAsync(stream, settings: settings, cancellationToken: cancellationToken).ConfigureAwait(false);
400399

401400
logger.LogTrace("{Timestamp}ms: Completed parsing.", stopwatch.ElapsedMilliseconds);
402401

src/Microsoft.OpenApi/Models/OpenApiOperation.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public void SerializeAsV3(IOpenApiWriter writer)
160160
/// </summary>
161161
private void SerializeInternal(IOpenApiWriter writer, OpenApiSpecVersion version, Action<IOpenApiWriter, IOpenApiSerializable> callback)
162162
{
163-
Utils.CheckArgumentNull(writer);;
163+
Utils.CheckArgumentNull(writer);
164164

165165
writer.WriteStartObject();
166166

0 commit comments

Comments
 (0)