Thanks, I also am also (slightly off topic) having problems with this section of code:
if (!IsArrayOrCollection(typeof(T)))
{
value = DocHelper.InsertId(value, key);
}
I am managing all the document IDs myself in my application. But DocHelper keeps interfering with my ID during deserialization. Is there a way we can possibly set a flag that wont interfere with my JSON ?
One example: All my domain objects have a strongly typed Guid as their ID.
The KEY to an Account object is "acct:aaaa-bb-cc-dd".
POCO in C#:
public class Account{
public Guid Id
{get;set;}
}
I format the key to this object inside my App; however, during deserialization DocHelper interferes with the JSON by injecting the KEY: "acct:aaaa-bb-cc-dd" into the ID property in the JSON before deseralization.
So when Newtonsoft deserializes the JSON with the injected DocHelper Id:Key:"acct:aaaa-bb-cc-dd" cannot be converted to a Guid because of the prefix "acct:" is an invalid Guid format. I'd prefer the SDK not interfere with any of my ser/deser JSON.
Perhaps we can add some flag that can short circuit the DocHelper injection?
Thanks,
Brian
Thanks for submitting bchavez!