-
-
Notifications
You must be signed in to change notification settings - Fork 510
Open
Description
Describe the bug
In F#, WithEnforceNullability has an effect on classes but not on records.
To Reproduce
In fsi:
#r "nuget: YamlDotNet
open YamlDotNet.Serialization
open YamlDotNet.Serialization.NamingConventions
let deserializer =
DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance)
.WithEnforceNullability()
.Build()
[<CLIMutable>]
type SomeRecord = {
Age: int
Name: string
}
type SomeClass() =
member val age = 999 with get, set
member val name = "" with get, set
// Defaults Age to 999
deserializer.Deserialize<SomeClass> """
Name: Blargh
"""
// Defaults Age to 0
deserializer.Deserialize<SomeRecord> """
name: Blorgh
"""Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels