summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-02-18 02:31:39 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-02-18 02:31:39 -0500
commitf1c24e30522499199cbf2f75cb68d7b4e5942bf3 (patch)
tree53985d7cfb785a2573a34731165e1007de7a9097
parent4444b590f016ebecfc113a0dd4584723b0250f41 (diff)
downloadSMAPI-f1c24e30522499199cbf2f75cb68d7b4e5942bf3.tar.gz
SMAPI-f1c24e30522499199cbf2f75cb68d7b4e5942bf3.tar.bz2
SMAPI-f1c24e30522499199cbf2f75cb68d7b4e5942bf3.zip
add support for ISemanticVersion in JSON models
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Framework/Models/Manifest.cs2
-rw-r--r--src/SMAPI/Framework/Serialisation/JsonHelper.cs3
3 files changed, 4 insertions, 2 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index f0a7a718..a1fb4a9d 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,6 +8,7 @@
* Updated compatibility list and enabled update checks for more old mods.
* For modders:
+ * Added support for `ISemanticVersion` in JSON models.
* Fixed deadlock in rare cases when injecting a file with an asset loader.
* Fixed unhelpful error when a mod exposes a non-public API.
diff --git a/src/SMAPI/Framework/Models/Manifest.cs b/src/SMAPI/Framework/Models/Manifest.cs
index 74303cba..f5867cf3 100644
--- a/src/SMAPI/Framework/Models/Manifest.cs
+++ b/src/SMAPI/Framework/Models/Manifest.cs
@@ -20,11 +20,9 @@ namespace StardewModdingAPI.Framework.Models
public string Author { get; set; }
/// <summary>The mod version.</summary>
- [JsonConverter(typeof(SemanticVersionConverter))]
public ISemanticVersion Version { get; set; }
/// <summary>The minimum SMAPI version required by this mod, if any.</summary>
- [JsonConverter(typeof(SemanticVersionConverter))]
public ISemanticVersion MinimumApiVersion { get; set; }
/// <summary>The name of the DLL in the directory that has the <see cref="IMod.Entry"/> method. Mutually exclusive with <see cref="ContentPackFor"/>.</summary>
diff --git a/src/SMAPI/Framework/Serialisation/JsonHelper.cs b/src/SMAPI/Framework/Serialisation/JsonHelper.cs
index 2e2a666e..6cba343e 100644
--- a/src/SMAPI/Framework/Serialisation/JsonHelper.cs
+++ b/src/SMAPI/Framework/Serialisation/JsonHelper.cs
@@ -21,6 +21,9 @@ namespace StardewModdingAPI.Framework.Serialisation
ObjectCreationHandling = ObjectCreationHandling.Replace, // avoid issue where default ICollection<T> values are duplicated each time the config is loaded
Converters = new List<JsonConverter>
{
+ // SMAPI types
+ new SemanticVersionConverter(),
+
// enums
new StringEnumConverter<Buttons>(),
new StringEnumConverter<Keys>(),