I am using Newtonsoft.Json.JsonConvert.SerializeObject
to convert a JsonPatchDocument<T>
to string but it's value
property (which is in JObject format) doesn't seem to be converted to string.
Here is the JSON I am using to create patchDocument
object
[
{
"path": "/expenseLines/",
"op": "ReplaceById",
"value": {
"ExpenseLineId": 1,
"Amount": 4.0,
"CurrencyAmount": 4.0,
"CurrencyCode": "GBP",
"ExpenseDate": "2021-11-01T00:00:00",
"ExpenseType": "TAXI"
}
}
]
This JSON is successfully deserialized to JsonPatchDocument
object but when I try to serialize it back to JSON, I lose value
property (as shown in the picture by red arrows).
Any help would be appreciated :)