tursodatabase / tursodatabase/libsql
[<JsonFSharpConverter(BaseUnionEncoding = _)>] not being honored
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 17.2k
- Forks
- 531
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 1
Description
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 *"} .
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the F# reproduction using JsonFSharpConverter, JsonFSharpOptions.Default(), and JsonUnionEncoding.Untagged, then compare the actual serialization with the expected output. Trace why the attribute is not honored when JsonSerializer.Serialize is called; done means the example produces {"sql":"select *"}.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100