Skip to content

Preview version for basic feature v1.0.0-beta.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@thohng thohng released this 17 Dec 09:28

Basic feature

const string json = "[ 123, \"abc\", { \"iss\": \"Sso Issuer\", \"iat\": 1607746395 }]";
var djson = System.Text.Json.JsonSerializer.Deserialize<DJson>(json);
Assert.Equal(3, djson.CountMembers);
Assert.Equal(123, (int)(long)djson[0]);
Assert.Equal(123L, djson[0]);
Assert.Equal("abc", djson[1]);
var jwtPayload = (DJson)djson[2];
Assert.Equal("Sso Issuer", jwtPayload["iss"]);
Assert.Equal(1607746395L, jwtPayload["iat"]);