Skip to content

Commit 2e5c5f8

Browse files
committed
If supplied, use the input OpenApi format as the output file extension, else default to the input file extension
1 parent 538013d commit 2e5c5f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ public static async Task TransformOpenApiDocument(HidiOptions options, ILogger l
5959
{
6060
if (options.Output == null)
6161
{
62-
var inputExtension = GetInputPathExtension(options.OpenApi, options.Csdl);
62+
#pragma warning disable CA1308 // Normalize strings to uppercase
63+
var inputExtension = string.Concat(".", options.OpenApiFormat.GetDisplayName().ToLowerInvariant())
64+
?? GetInputPathExtension(options.OpenApi, options.Csdl);
65+
#pragma warning restore CA1308 // Normalize strings to uppercase
6366
options.Output = new($"./output{inputExtension}");
6467
};
6568

0 commit comments

Comments
 (0)