今日Newtonsoft.Jsonからの奇妙な出力に気づきましたが、F#の種類やC#で発生する可能性のあるものとのインタラクションかどうかはわかりません。 。私は、次のレコードのリストが連載されています:Newtonsoft.Jsonいくつかの項目を2回シリアル化する
type SplitTracker =
{
[<JsonIgnore>]
split : SplitDefinition
mutable start : duration
mutable ``end`` : duration
mutable lapCount : int
mutable duration : duration Option
}
私はJsonConvert.SerializeObject
でそれをシリアル化し、私は次の奇妙な出力を得る:それは起きている可能性がある理由
"splits": [
{
"[email protected]": "0.00",
"[email protected]": "0.00",
"[email protected]": 0,
"[email protected]": null,
"start": "0.00",
"end": "0.00",
"lapCount": 0,
"duration": null
},
{
"[email protected]": "0.00",
"[email protected]": "0.00",
"[email protected]": 0,
"[email protected]": null,
"start": "0.00",
"end": "0.00",
"lapCount": 0,
"duration": null
}
誰もが知っているの?データは正しいですが、 "@"記号でフィールドを複製することが重要です。
ありがとう、私はカスタムコンバータで修正できるかのように見えるか、多分可変変数なしでこのアルゴリズムを見つけ出すことができますか? – jackmott
あなたの可変フィールドに '[]'無視されます。 –
Tarmil
@ジャックモット:あなたのアルゴリズムを突然変異に頼らないように再考する方法があると思います。疑わしい場合は、ここに投稿してください。 –