Closed ImaginaryDevelopment closed 2 years ago
If this is something you need then you can use JsonFSharpConverter(allowNullFields = true)
.
If this is truly intended behavior, simple nullable types throwing, then I guess this issue can be closed. I did not expect this to be by design.
Was also bitten by this today, but in the context of a DU:
type SomeUnion =
| Something of string
What's weird is that I can successfully serialize null |> SomeUnion.Something
just fine, but deserializing it fails with the stated error message.
For me, allowNullFields = true
hasn't helped (perhaps due to being a DU?)
@kentcb If this also fails with allowNullFields = true
, then I think your issue is actually closer to #106.
I don't think null strings should throw at all anywhere
Simple record with a null string throws.
JsonException: Test.ProjectId was expected to be of type String, but was null.