I’m developing a CBLite datalayer within a Xamarin (C# ofc) project and I’ve encountered an odd problem.
Our data can be highly nested/embedded with rules based on the type that it describes, so some properties can be arrays of json objects, or just value arrays, or just json objects.
However, much in the same way I noticed this problem in our webAPI layer, Newtonsoft Json does not recursively deserialise nested structures. So when I’m in my map function trying to map against properties nested at ‘n’ depth, my application crashes because I’m no longer working with IDictionaries, but JObjects.
For my web layer I ended up implementing a recursive deserialiser, but my question is if there’s a more elegant solution with CBLite?
I can happily have my top level map function ensure it does a recursive deserialise, but I was hoping that I might be able to inject this behaviour into the CouchbaseDatabase object?
Any ideas for a neater solution would be very much welcomed!