Closed SamuelBerger closed 1 year ago
While I understand this change I think the previous default was the sane behavior and having expectations like built in is wrong.
So while I look into an replacement library, if any, it would be nice that the previous behaviour was at least an option.
Yes, I see that this is a common request. I agree that we should add an option to have the previous behavior without needing IgnoreNullValues/DefaultIgnoreCondition.
The new option SkippableOptionFields was added in v1.1 for this use case. https://github.com/Tarmil/FSharp.SystemTextJson/blob/master/docs/Customizing.md#skippable-option-fields
🤩Thank you @Tarmil ! You're the best!
While updating to release version, our CI hits the breaking change #123 :(
Is there a way to configure the old behaviour:
IgnoreNullValues = true or DefaultIgnoreCondition = WhenWritingNull affects serializing as well.
Am I missing a trick (without changing all option properties to Skippable)?
(Throwing an exception for missing non option record properties is pure gold, so allowNullFields would never be an option.)
If there isn't a way to get the old behaviour, would a configuration
optionFieldsSkippable
be considered an improvement to the library?