From 25e797d63b11398b11daebc8a13b51a1824a82d1 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sun, 12 May 2024 11:15:46 +0200 Subject: [PATCH] Suppress compiler warning in generated code for unused field --- src/NSwag.CodeGeneration.CSharp/Templates/File.Header.liquid | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NSwag.CodeGeneration.CSharp/Templates/File.Header.liquid b/src/NSwag.CodeGeneration.CSharp/Templates/File.Header.liquid index 27bf6e6ce..cad35b443 100644 --- a/src/NSwag.CodeGeneration.CSharp/Templates/File.Header.liquid +++ b/src/NSwag.CodeGeneration.CSharp/Templates/File.Header.liquid @@ -2,6 +2,7 @@ #pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' #pragma warning disable 612 // Disable "CS0612 '...' is obsolete" +#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" @@ -9,4 +10,4 @@ #pragma warning disable 8603 // Disable "CS8603 Possible null reference return" #pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" #pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" -#pragma warning disable CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes). \ No newline at end of file +#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." \ No newline at end of file