You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed this issue when using ThothLike().WithSkippableOptionFields() however a minimal repro can be achieved with WithSkippableOptionFields() alone.
Repro:
open System.Text.Json
open System.Text.Json.Serialization
let opts = JsonFSharpOptions().WithSkippableOptionFields().ToJsonSerializerOptions()
type MyUnion =
| Case1 of int option
| Case2 of bool option
type MyRecord = { Field1: MyUnion }
let json = JsonSerializer.Serialize({ Field1 = Case1 None }, opts)
let value = JsonSerializer.Deserialize<MyRecord>(json, opts)
Throws exception:
Unhandled exception. System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $ | LineNumber: 0 | BytePositionInLine: 4.
---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
The text was updated successfully, but these errors were encountered:
Noticed this issue when using
ThothLike().WithSkippableOptionFields()
however a minimal repro can be achieved withWithSkippableOptionFields()
alone.Repro:
Throws exception:
The text was updated successfully, but these errors were encountered: