Skip to content

Commit

Permalink
Catch numbers in Geraetemerkmal (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoschaMetze authored Oct 19, 2023
1 parent 7d74ba5 commit 9bdc151
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public class LenientSystemTextGeraetemerkmalGasConverter : System.Text.Json.Seri
/// </summary>
public override Geraetemerkmal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Number)
{
return Geraetemerkmal.EINTARIF;
}
var rawString = reader.GetString();
try
{
Expand Down Expand Up @@ -51,6 +55,10 @@ public class LenientSystemTextNullableGeraetemerkmalGasConverter : System.Text.J
/// </summary>
public override Geraetemerkmal? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Number)
{
return null;
}
var rawString = reader.GetString();
if (rawString is null)
{
Expand Down

0 comments on commit 9bdc151

Please sign in to comment.