summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs')
-rw-r--r--src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs b/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs
index a0cd9d4d..d1b7fa4d 100644
--- a/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs
+++ b/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs
@@ -1,3 +1,4 @@
+using System;
using System.Linq;
using StardewModdingAPI.Toolkit.Utilities;
@@ -28,6 +29,15 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
/*********
** Public methods
*********/
+ /// <summary>Construct an empty instance.</summary>
+ [Obsolete("This constructor only exists to support ASP.NET model binding, and shouldn't be used directly.")]
+ 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.
+ }
+
/// <summary>Construct an instance.</summary>
/// <param name="mods">The mods to search.</param>
/// <param name="apiVersion">The SMAPI version installed by the player. If this is null, the API won't provide a recommended update.</param>