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
There's a mismatch on the encoding for union cases with a single field when using JsonUnionEncoding.FSharpLuLike. In cases where field count = 1 FSharpLu will just serialize the object instead an array with the one object.
Example for type SingleFieldCase = Single of string
Current FSharpLuLike encoding: {"Single":["hi"]}
Actual FSharpLu encoding: { "Single": "hi" }
I was not sure what the best way to approach this would be wrt affecting other encoding options. Happy to help implement any acceptable changes as needed.
The text was updated successfully, but these errors were encountered:
Good catch! I think a good way to fix this would be to add an option to the JsonUnionEncoding enum, something like SuccintSingleFieldUnions = 0x10_00, that enables this behavior, and then FSharpLuLike would be 0x16_02.
There's a mismatch on the encoding for union cases with a single field when using
JsonUnionEncoding.FSharpLuLike
. In cases where field count = 1 FSharpLu will just serialize the object instead an array with the one object.Example for
type SingleFieldCase = Single of string
Current FSharpLuLike encoding:
{"Single":["hi"]}
Actual FSharpLu encoding:
{ "Single": "hi" }
I was not sure what the best way to approach this would be wrt affecting other encoding options. Happy to help implement any acceptable changes as needed.
The text was updated successfully, but these errors were encountered: