jeudi 25 juillet 2019

JsonConvert.DeserializeObject throws exception when desalinizing json with int that doesn't fit range

My class MyData has sbyte members.

I'm using the following

var deserialized = JsonConvert.DeserializeObject<List<MyData>>(JsonStr);

Some values exceed sbyte range, for example 0xAA. As a result, exception are thrown. When I change the value to 0x1, for example, it works.

I can not touch the code of MyData. It's machine-generated. I expect use of conversion settings, override of something, use of LINQ e.t.c





Aucun commentaire:

Enregistrer un commentaire