Whi*_*ard 5 serialization f# json json.net
这是我的代码:
open Newtonsoft.Json
open Newtonsoft.Json.Converters
type T = {
mutable name : string;
mutable height : int;
}
let a = { name = "abc"; height = 180;}
a.height <- 200
let b = JsonConvert.SerializeObject(a, Formatting.Indented)
printfn "%s" b
Run Code Online (Sandbox Code Playgroud)
代码的输出是:
{
"name@": "abc",
"height@": 200,
"name": "abc",
"height": 200
}
Run Code Online (Sandbox Code Playgroud)
如何以正确的"@"来避免输出?