Skip to content

Commit

Permalink
fix numeric type
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieSinn committed Oct 26, 2023
1 parent a07a5ee commit 6bccfb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override Value Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe
case JsonTokenType.String:
return new Value(reader.GetString());
case JsonTokenType.Number:
return new Value(reader.GetDecimal());
return new Value(reader.GetDouble());
case JsonTokenType.True:
return new Value(true);
case JsonTokenType.False:
Expand Down
4 changes: 3 additions & 1 deletion DevCycle.SDK.Server.Local.MSTests/DevCycleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ public void TestOpenFeatureSerialization()
{
{ "key", new Value("value") },
{ "key2", new Value(new Structure(simpleDict)) },
{ "listKey", new Value(listDict) }
{ "listKey", new Value(listDict) },
{"numberKey", new Value(1d)}
};

var defaultV = new Value(new Structure(jsonDict));
Expand All @@ -395,6 +396,7 @@ public void TestOpenFeatureSerialization()
Assert.AreEqual(defaultV.IsStructure, deserialzed.IsStructure);
Assert.AreEqual(defaultV.AsStructure.GetValue("key").AsString,
deserialzed.AsStructure.GetValue("key").AsString);
Assert.AreEqual(1, deserialzed.AsStructure.GetValue("numberKey").AsInteger);
}
}
}

0 comments on commit 6bccfb2

Please sign in to comment.