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
System.Text.Json.JsonException: The converter 'System.Text.Json.Serialization.JsonUnionConverter`1[KT.Takst.Domain+ForholdVedBygg]' read too much or not enough. Path: $[1] | LineNumber: 0 | BytePositionInLine: 24.
using these options:
let serializerOptions =
let rules =
JsonUnionEncoding.InternalTag ||| JsonUnionEncoding.EraseSingleCaseUnions ||| JsonUnionEncoding.SuccintOption
||| JsonUnionEncoding.BareFieldlessTags
let serializerOptions =
JsonSerializerOptions(PropertyNamingPolicy = JsonNamingPolicy.CamelCase, DictionaryKeyPolicy = JsonNamingPolicy.CamelCase)
serializerOptions.Converters.Add(JsonFSharpConverter(rules))
Given example:
type Color = Red | Blue | Green
JsonSerializer.Deserialize<Color list>("""[ "Red", "Blue"] """, serializerOptions)
The text was updated successfully, but these errors were encountered:
using these options:
Given example:
The text was updated successfully, but these errors were encountered: