Skip to content

Commit

Permalink
update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Aug 13, 2024
1 parent 4e8d7fc commit 6d7c1a0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ public partial class Root
get { return email; }
set { this.email = value; }
}
public string Serialize()
{
return this.Serialize(null);
}
public string Serialize(JsonSerializerOptions options = null)
return JsonSerializer.Serialize(this, options);
}
public static Root Deserialize(string json)
{
var deserializeOptions = new JsonSerializerOptions();
deserializeOptions.Converters.Add(new RootConverter());
return JsonSerializer.Deserialize<Root>(json, deserializeOptions);
}
}
internal class RootConverter : JsonConverter<Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ public partial class Test
get { return additionalProperties; }
set { this.additionalProperties = value; }
}
public string Serialize()
{
return this.Serialize(null);
}
public string Serialize(JsonSerializerOptions options = null)
return JsonSerializer.Serialize(this, options);
}
public static Test Deserialize(string json)
{
var deserializeOptions = new JsonSerializerOptions();
deserializeOptions.Converters.Add(new TestConverter());
return JsonSerializer.Deserialize<Test>(json, deserializeOptions);
}
}
internal class TestConverter : JsonConverter<Test>
Expand Down Expand Up @@ -223,6 +238,21 @@ public partial class NestedTest
get { return additionalProperties; }
set { this.additionalProperties = value; }
}
public string Serialize()
{
return this.Serialize(null);
}
public string Serialize(JsonSerializerOptions options = null)
return JsonSerializer.Serialize(this, options);
}
public static NestedTest Deserialize(string json)
{
var deserializeOptions = new JsonSerializerOptions();
deserializeOptions.Converters.Add(new NestedTestConverter());
return JsonSerializer.Deserialize<NestedTest>(json, deserializeOptions);
}
}
internal class NestedTestConverter : JsonConverter<NestedTest>
Expand Down

0 comments on commit 6d7c1a0

Please sign in to comment.