summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-08-08 00:12:47 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-08-08 00:12:47 -0400
commit03e679d66cc7439b0218c95cbead925786e37e86 (patch)
tree9002440ea14dfdd1363e3a0587c9d807695ca7a4 /src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
parent8df5d79c9e01c2d665192ba5accfcd45a47e2dda (diff)
downloadSMAPI-03e679d66cc7439b0218c95cbead925786e37e86.tar.gz
SMAPI-03e679d66cc7439b0218c95cbead925786e37e86.tar.bz2
SMAPI-03e679d66cc7439b0218c95cbead925786e37e86.zip
serialise all enums to string in JSON by default
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs')
-rw-r--r--src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs b/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
index 00f334ad..3cabbab3 100644
--- a/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
+++ b/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
using StardewModdingAPI.Toolkit.Serialisation.Converters;
namespace StardewModdingAPI.Toolkit.Serialisation
@@ -17,7 +18,11 @@ namespace StardewModdingAPI.Toolkit.Serialisation
{
Formatting = Formatting.Indented,
ObjectCreationHandling = ObjectCreationHandling.Replace, // avoid issue where default ICollection<T> values are duplicated each time the config is loaded
- Converters = new List<JsonConverter> { new SemanticVersionConverter() }
+ Converters = new List<JsonConverter>
+ {
+ new SemanticVersionConverter(),
+ new StringEnumConverter()
+ }
};