[<JsonFSharpConverter(BaseUnionEncoding = _)>] not being honored
Author: reinuxCreated Aug 31, 2026Updated Aug 31, 2026
Example:
[<JsonFSharpConverter(BaseUnionEncoding = JsonUnionEncoding.Untagged)>]
type Sql =
| Sql of sql: string
| SqlId of sqlId: int
let options =
JsonFSharpOptions.Default()
.WithAllowOverride(true)
.ToJsonSerializerOptions()
JsonSerializer.Serialize(Sql "select *", options)
type Sql =
| Sql of sql: string
| SqlId of sqlId: int
val options: JsonSerializerOptions
val it: string = "{"Case":"Sql","Fields":["select *"]}"Expecting {"sql":"select *"} .
Source: tursodatabase/libsql