Define JSON serialization options on World

This commit is contained in:
Tim Van Baak 2024-08-14 09:16:53 -07:00
parent 5ad57465d8
commit 31bd6a45cb
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,4 @@
using System.Text.Json;
using System.Text.Json.Serialization;
namespace MultiversalDiplomacy.Model;
@ -7,6 +8,11 @@ namespace MultiversalDiplomacy.Model;
/// </summary>
public class World
{
public static readonly JsonSerializerOptions JsonOptions = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
};
/// <summary>
/// The map variant of the game.
/// </summary>

View File

@ -9,9 +9,8 @@ namespace MultiversalDiplomacyTests;
public class SerializationTest
{
private JsonSerializerOptions Options = new() {
private JsonSerializerOptions Options = new(World.JsonOptions) {
WriteIndented = true,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
};
[Test]