summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-01 17:31:54 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-01 17:31:54 -0400
commitea9324586d4aaafd9d18f09e0bf110e57d86c449 (patch)
tree686ded3369221a8be29b43a2052b4d6260303a82 /src
parentdb43fc22a4c7f5eb16a44d3b83ecba3f39ab5dc6 (diff)
downloadSMAPI-ea9324586d4aaafd9d18f09e0bf110e57d86c449.tar.gz
SMAPI-ea9324586d4aaafd9d18f09e0bf110e57d86c449.tar.bz2
SMAPI-ea9324586d4aaafd9d18f09e0bf110e57d86c449.zip
fix warnings for model-binding hack
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs5
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>