fix model binding for mod update-check API

This commit is contained in:
Jesse Plamondon-Willard 2022-04-30 12:33:33 -04:00
parent f507bd0f9c
commit ed337ab964
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,4 @@
using System;
using System.Linq; using System.Linq;
using StardewModdingAPI.Toolkit.Utilities; using StardewModdingAPI.Toolkit.Utilities;
@ -28,6 +29,15 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
/********* /*********
** Public methods ** 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> /// <summary>Construct an instance.</summary>
/// <param name="mods">The mods to search.</param> /// <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> /// <param name="apiVersion">The SMAPI version installed by the player. If this is null, the API won't provide a recommended update.</param>