diff --git a/CHANGELOG.md b/CHANGELOG.md index dc43b2d1fd..b184c3914f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The default status code response is now used as 4XX and 5XX when those class responses are not provided in the description. [#3245](https://github.com/microsoft/kiota/issues/3245) - Adds codes files in typescript to reduce number of generated files. [#2116](https://github.com/microsoft/kiota/issues/2116) - Fix null reference exception when a parameter is defined without a schema. (CLI). -- Log a message to stderr if a request is skipped due to missing data. (CLI) [2210](https://github.com/microsoft/kiota/issues/2210) +- Log a message to stderr if a request is skipped due to missing data. (CLI) [#2210](https://github.com/microsoft/kiota/issues/2210) ## [1.6.1] - 2023-09-11 diff --git a/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs b/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs index 16c37788a6..449d7e1931 100644 --- a/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs @@ -664,8 +664,7 @@ protected virtual void WriteCommandHandlerBody(CodeMethod codeElement, CodeClass // Check for null model // Add logging with reason for skipped execution here - writer.WriteLine("if (model is null)"); - writer.StartBlock(); + writer.StartBlock("if (model is null)"); writer.WriteLine("Console.Error.WriteLine(\"No model data to send.\");"); writer.WriteLine("return;"); writer.CloseBlock(); @@ -679,8 +678,7 @@ protected virtual void WriteCommandHandlerBody(CodeMethod codeElement, CodeClass requestBodyParam.Name = "stream"; // Check for file existence // Add logging with reason for skipped execution here - writer.WriteLine($"if ({pName} is null || !{pName}.Exists)"); - writer.StartBlock(); + writer.StartBlock($"if ({pName} is null || !{pName}.Exists)"); writer.WriteLine("Console.Error.WriteLine(\"No available file to send.\");"); writer.WriteLine("return;"); writer.CloseBlock();