Skip to content

Commit

Permalink
If supplied, use the input OpenApi format as the output file extensio…
Browse files Browse the repository at this point in the history
…n, else default to the input file extension
  • Loading branch information
MaggieKimani1 committed Feb 28, 2024
1 parent 538013d commit 2e5c5f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Microsoft.OpenApi.Hidi/OpenApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ public static async Task TransformOpenApiDocument(HidiOptions options, ILogger l
{
if (options.Output == null)
{
var inputExtension = GetInputPathExtension(options.OpenApi, options.Csdl);
#pragma warning disable CA1308 // Normalize strings to uppercase
var inputExtension = string.Concat(".", options.OpenApiFormat.GetDisplayName().ToLowerInvariant())
?? GetInputPathExtension(options.OpenApi, options.Csdl);
#pragma warning restore CA1308 // Normalize strings to uppercase
options.Output = new($"./output{inputExtension}");
};

Expand Down

0 comments on commit 2e5c5f8

Please sign in to comment.