diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-01 17:31:54 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-01 17:31:54 -0400 |
commit | ea9324586d4aaafd9d18f09e0bf110e57d86c449 (patch) | |
tree | 686ded3369221a8be29b43a2052b4d6260303a82 /src/SMAPI.Toolkit/Framework | |
parent | db43fc22a4c7f5eb16a44d3b83ecba3f39ab5dc6 (diff) | |
download | SMAPI-ea9324586d4aaafd9d18f09e0bf110e57d86c449.tar.gz SMAPI-ea9324586d4aaafd9d18f09e0bf110e57d86c449.tar.bz2 SMAPI-ea9324586d4aaafd9d18f09e0bf110e57d86c449.zip |
fix warnings for model-binding hack
Diffstat (limited to 'src/SMAPI.Toolkit/Framework')
-rw-r--r-- | src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs b/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs index d1b7fa4d..3c74bab0 100644 --- a/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs +++ b/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Linq; using StardewModdingAPI.Toolkit.Utilities; @@ -31,11 +32,15 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi *********/ /// <summary>Construct an empty instance.</summary> [Obsolete("This constructor only exists to support ASP.NET model binding, and shouldn't be used directly.")] + [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Used by ASP.NET model binding.")] public ModSearchModel() { // ASP.NET Web API needs a public empty constructor for top-level request models, and // it'll fail if the other constructor is marked with [JsonConstructor]. Apparently // it's fine with non-empty constructors in nested models like ModSearchEntryModel. + this.Mods = Array.Empty<ModSearchEntryModel>(); + this.ApiVersion = null!; + this.GameVersion = null!; } /// <summary>Construct an instance.</summary> |