summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs')
-rw-r--r--src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs b/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
index dcc0dac4..cf2ce0d1 100644
--- a/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
+++ b/src/StardewModdingAPI.Toolkit/Serialisation/JsonHelper.cs
@@ -127,9 +127,10 @@ namespace StardewModdingAPI.Toolkit.Serialisation
/// <summary>Serialize a model to JSON text.</summary>
/// <typeparam name="TModel">The model type.</typeparam>
/// <param name="model">The model to serialise.</param>
- public string Serialise<TModel>(TModel model)
+ /// <param name="formatting">The formatting to apply.</param>
+ public string Serialise<TModel>(TModel model, Formatting formatting = Formatting.Indented)
{
- return JsonConvert.SerializeObject(model, this.JsonSettings);
+ return JsonConvert.SerializeObject(model, formatting, this.JsonSettings);
}
}
}