Skip to content

Commit 79ce5a9

Browse files
Erik Bylundkirre-bylund
authored andcommitted
fix: Change json serializer to serialize enums as strings
1 parent 3b0918c commit 79ce5a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Runtime/Client/LootLockerServerRequest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#if LOOTLOCKER_USE_NEWTONSOFTJSON
66
using Newtonsoft.Json;
77
using Newtonsoft.Json.Serialization;
8+
using Newtonsoft.Json.Converters;
89
#else
910
using LLlibs.ZeroDepJson;
1011
#endif
@@ -22,10 +23,11 @@ public static class LootLockerJsonSettings
2223
public static readonly JsonSerializerSettings Default = new JsonSerializerSettings
2324
{
2425
ContractResolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() },
26+
Converters = {new StringEnumConverter()},
2527
Formatting = Formatting.None
2628
};
2729
#else
28-
public static readonly JsonOptions Default = new JsonOptions(JsonSerializationOptions.Default & ~JsonSerializationOptions.SkipGetOnly);
30+
public static readonly JsonOptions Default = new JsonOptions((JsonSerializationOptions.Default | JsonSerializationOptions.EnumAsText) & ~JsonSerializationOptions.SkipGetOnly);
2931
#endif
3032
}
3133

0 commit comments

Comments
 (0)