Skip to content

Commit

Permalink
Merge pull request #54 from manzanotti/FixResizeCalls
Browse files Browse the repository at this point in the history
Add null handling to json serialization
  • Loading branch information
ctolkien authored May 16, 2024
2 parents e0ba757 + 359f748 commit 6c63607
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TinyPNG/TinyPngClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using TinyPng.Responses;

Expand All @@ -30,7 +31,8 @@ static TinyPngClient()
JsonOptions = new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};

JsonOptions.Converters.Add(new CustomJsonStringEnumConverter(JsonNamingPolicy.CamelCase));
Expand Down

0 comments on commit 6c63607

Please sign in to comment.