Tarmil / FSharp.SystemTextJson

System.Text.Json extensions for F# types
MIT License
323 stars 44 forks source link

Regression: 1.0 can't deserialize to non-public records #133

Closed cmeeren closed 1 year ago

cmeeren commented 1 year ago

I haven't done extensive testing, so the problem may be bigger than just internal records. But this fails with an exception:

open System.Text.Json
open System.Text.Json.Serialization

type internal T = { foo: string }
let json = """{ "foo": "" }"""

let private options = JsonSerializerOptions()
options.Converters.Add(JsonFSharpConverter())

JsonSerializer.Deserialize<T>(json, options) |> ignore

If I remove internal from the type definition, it works.

This worked fine in 0.19.13.

cmeeren commented 1 year ago

Out of curiosity, any chance to fix this within a handful of days? I have some work that is semi-blocked by this. (Possible to work around, but cumbersome.)

Would like to help out, but unfortunately life is in the way for the foreseeable future; I'm completely swamped with other work.

Tarmil commented 1 year ago

Fixed in v1.0.6 🙂

cmeeren commented 1 year ago

Excellent, thank you so much! 🎉