There is some issue while deserializing json with snake_case notation.
Just found it in the 5.13.2 version.
How to reproduce:
class Dto
{
public int? Property { get; set; }
public int? AnotherProperty { get; set; }
}
// Program.Main()
JsConfig.Init(new Config
{
TextCase = TextCase.SnakeCase
});
var dto = new Dto { Property = 1, AnotherProperty = 1 };
var json = dto.ToJson(); // json: {"property": 1, "another_property": 1}
var anotherDto = json.FromJson<Dto>(); // anotherDto.AnotherProperty is null
The serialization looks good and the property names with capital letters in the middle got “snake_cased”, however while trying to deserialize back, the very same property has no value assigned.