Define JSON serialization options on World
This commit is contained in:
parent
5ad57465d8
commit
31bd6a45cb
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace MultiversalDiplomacy.Model;
|
namespace MultiversalDiplomacy.Model;
|
||||||
|
@ -7,6 +8,11 @@ namespace MultiversalDiplomacy.Model;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class World
|
public class World
|
||||||
{
|
{
|
||||||
|
public static readonly JsonSerializerOptions JsonOptions = new()
|
||||||
|
{
|
||||||
|
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The map variant of the game.
|
/// The map variant of the game.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -9,9 +9,8 @@ namespace MultiversalDiplomacyTests;
|
||||||
|
|
||||||
public class SerializationTest
|
public class SerializationTest
|
||||||
{
|
{
|
||||||
private JsonSerializerOptions Options = new() {
|
private JsonSerializerOptions Options = new(World.JsonOptions) {
|
||||||
WriteIndented = true,
|
WriteIndented = true,
|
||||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
Loading…
Reference in New Issue