diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-30 12:33:33 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-30 12:33:33 -0400 |
commit | ed337ab9644527465205547bd7e319194df553ab (patch) | |
tree | abf51414a95405539149bc69280bb45aa06a8890 /src | |
parent | f507bd0f9cebe68fa2adf176740a0d00b3e6f884 (diff) | |
download | SMAPI-ed337ab9644527465205547bd7e319194df553ab.tar.gz SMAPI-ed337ab9644527465205547bd7e319194df553ab.tar.bz2 SMAPI-ed337ab9644527465205547bd7e319194df553ab.zip |
fix model binding for mod update-check API
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI.Toolkit/Framework/Clients/WebApi/ModSearchModel.cs | 10 |
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> |