Closed rickparrish closed 3 months ago
Thanks. I guess some fix in the F# compiler now caused the build to fail since apparently that has been obsolete for a while now.
There are also uses in Configuration.fs
that need to be fixed.
Thanks. I guess some fix in the F# compiler now caused the build to fail since apparently that has been obsolete for a while now.
While investigating I came across this stream that seems relevant, although I didn't actually watch it so I'm just going off the description given ("Obsolete attribute is ignored in constructor property assignment"). https://amplifyingfsharp.io/sessions/2024/03/22/
There are also uses in
Configuration.fs
that need to be fixed.
What would your preference there be?
let options = JsonSerializerOptions(WriteIndented = true, IgnoreNullValues = true)
to
let options = JsonSerializerOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)
or
let options = FSharpJsonOptions.Create(indent = true, ignoreNull = true)
I guess they're not quite equivalent, because the latter also does options.Converters.Add(JsonFSharpConverter())
?
What would your preference there be?
For load
the options can just be removed since they shouldn't even matter there.
For save
, it can be changed to let options = FSharpJsonOptions.Create(indent = true, ignoreNull = true)
even though the JsonFSharpConverter
isn't necessary there.
Sounds good to me, I've pushed those changes.
…the latest VS 2022 build (17.10.0)
DefaultIgnoreCondition seems to be the new property to ignore null values (https://learn.microsoft.com/en-us/dotnet/api/system.text.json.jsonserializeroptions.ignorenullvalues?view=net-8.0)
I've only tested that the project compiles after making these changes, I'm not 100% sure that
DefaultIgnoreCondition = JsonIgnoreCondition.Never
is the equivalent ofIgnoreNullValues = false
, or thatJsonIgnoreCondition.WhenWritingNull
is the equivalent oftrue
.