Add meta and settings json
This commit is contained in:
15
ALttPRandomizer/JsonOptions.cs
Normal file
15
ALttPRandomizer/JsonOptions.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace ALttPRandomizer {
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
public static class JsonOptions {
|
||||
public static JsonSerializerOptions Default = new JsonSerializerOptions() {
|
||||
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
|
||||
}.WithStringEnum();
|
||||
|
||||
public static JsonSerializerOptions WithStringEnum(this JsonSerializerOptions options) {
|
||||
options.Converters.Add(new JsonStringEnumConverter());
|
||||
return options;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user