YamlDotNet icon indicating copy to clipboard operation
YamlDotNet copied to clipboard

How do I serialize an F# record without having it output duplicate fields with `@` signs at the end?

Open mrakgr opened this issue 10 months ago • 7 comments
trafficstars

Example code:

#r "nuget: YamlDotNet, 16.3.0"
open YamlDotNet
open System

[<CLIMutable>]
type t = {
    qwer : string
    asdf : int
}

let t = {
    qwer = "hello"
    asdf = 1234
}

let serializer = new Serialization.Serializer()
serializer.Serialize(Console.Out, t)

Here is what it outputs when I run it.

qwer@: hello
asdf@: 1234
qwer: hello
asdf: 1234

How do I prevent it from generating those extraneus duplicate fields ending in @?

mrakgr avatar Jan 17 '25 10:01 mrakgr