nakama-dotnet icon indicating copy to clipboard operation
nakama-dotnet copied to clipboard

Fixes issue with parsing unquoted numbers as strings in TinyJson, whe…

Open tomglenn opened this issue 3 years ago • 2 comments

…re the first and last number would be trimmed

tomglenn avatar Aug 05 '22 12:08 tomglenn

Do you know how TinyJSON serializes 64 bit integers? We should probably maintain symmetry.

lugehorsam avatar Aug 05 '22 12:08 lugehorsam

Do you know how TinyJSON serializes 64 bit integers? We should probably maintain symmetry.

It serializes long as unquoted.

This test passes:

[Fact(Timeout = TestsUtil.TIMEOUT_MILLISECONDS)]
public void ToJson_LongToJson()
{
    var obj = new Dictionary<string, long>();
    obj["key"] = 1234567891234;
    var json = obj.ToJson();
    
    Assert.Equal("{\"key\":1234567891234}", json);
}

tomglenn avatar Aug 05 '22 13:08 tomglenn

Apologies @lugehorsam this slipped off my radar. Please see latest change.

tomglenn avatar Sep 09 '22 10:09 tomglenn