diff --git a/WebApiClientGenCore/ClientApiFunctionGen.cs b/WebApiClientGenCore/ClientApiFunctionGen.cs index bb1a6f40..eba39d6e 100644 --- a/WebApiClientGenCore/ClientApiFunctionGen.cs +++ b/WebApiClientGenCore/ClientApiFunctionGen.cs @@ -425,21 +425,20 @@ void AddRequestUriWithQueryAssignmentStatement() { if (codeGenOutputsSettings.UseSystemTextJson) { - //clientMethod.Statements.Add(new CodeSnippetStatement(ThreeTabs + $"var contentJson = JsonSerializer.Serialize({singleFromBodyParameterDescription.ParameterDescriptor.ParameterName}, jsonSerializerSettings);")); clientMethod.Statements.Add(new CodeSnippetStatement(ThreeTabs + $"var content = System.Net.Http.Json.JsonContent.Create({singleFromBodyParameterDescription.ParameterDescriptor.ParameterName}, mediaType: null, jsonSerializerSettings);")); } else { clientMethod.Statements.Add(new CodeSnippetStatement( - $"\t\t\tusing var requestWriter = new System.IO.StringWriter();{Environment.NewLine}\t\t\tvar requestSerializer = JsonSerializer.Create(jsonSerializerSettings);" - )); + $"\t\t\tusing var requestWriter = new System.IO.StringWriter();{Environment.NewLine}\t\t\tvar requestSerializer = JsonSerializer.Create(jsonSerializerSettings);" + )); clientMethod.Statements.Add(new CodeMethodInvokeExpression(new CodeSnippetExpression("requestSerializer"), "Serialize", new CodeSnippetExpression("requestWriter"), new CodeSnippetExpression(singleFromBodyParameterDescription.ParameterDescriptor.ParameterName))); clientMethod.Statements.Add(new CodeSnippetStatement( - @" var content = new StringContent(requestWriter.ToString(), System.Text.Encoding.UTF8, ""application/json"");" + "\t\t\tvar content = new StringContent(requestWriter.ToString(), System.Text.Encoding.UTF8, \"application/json\");" )); }