Tarmil / FSharp.SystemTextJson

System.Text.Json extensions for F# types
MIT License
323 stars 44 forks source link

Record deserialization throws NRE if ignore null values is on #164

Closed mlaily closed 11 months ago

mlaily commented 12 months ago

Hello!

It seems there is some issue with the JsonRecordConverter: when ignoreNullValues is on (e.g. set with option DefaultIgnoreCondition = Serialization.JsonIgnoreCondition.WhenWritingNull), attempting to deserialize an empty json object throws a NullReferenceException.

I'm not sure how to fix this properly, but I managed to add a failing unit test demonstrating the issue: https://github.com/Tarmil/FSharp.SystemTextJson/pull/165

image