Skip to content

Commit 06fd1df

Browse files
committed
Clean up logic
1 parent 11e5c63 commit 06fd1df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ public static async Task TransformOpenApiDocument(HidiOptions options, ILogger l
6060
if (options.Output == null)
6161
{
6262
#pragma warning disable CA1308 // Normalize strings to uppercase
63-
var inputExtension = string.Concat(".", options.OpenApiFormat?.GetDisplayName().ToLowerInvariant())
64-
?? GetInputPathExtension(options.OpenApi, options.Csdl);
63+
var extension = options.OpenApiFormat?.GetDisplayName().ToLowerInvariant();
64+
var inputExtension = !string.IsNullOrEmpty(extension) ? string.Concat(".", extension)
65+
: GetInputPathExtension(options.OpenApi, options.Csdl);
66+
6567
#pragma warning restore CA1308 // Normalize strings to uppercase
6668
options.Output = new($"./output{inputExtension}");
6769
};

0 commit comments

Comments
 (0)