Tarmil / FSharp.SystemTextJson

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

Nullref when deserializing Skip with FSharp.Core 5 #83

Closed Tarmil closed 3 years ago

Tarmil commented 3 years ago

The record deserializer assumes that an absent field can be left as null, but that is not the case for Skippable because it's a struct. I think ValueNone may have the same issue.

A solution would be to replace the Array.zeroCreate in the record deserializer with cloning a statically constructed array that contains a boxed Skip or ValueNone where required.