SDK 2.0: custom serialization


We store our documents with type name handling equal to ‘objects’ (automatically adds $type). Even when I set the client configuration serialization settings to this, the documents generated do not include this property. After digging around in the SDK this seems to be related to the fact that the serialization settings do not always get passed on.

I tried serializing the objects myself, but they then get stored as a string and I have to also custom deserialize them (since the SDK returns them as a string). Which causes some silly code that I would rather not have around.

Is there a clean way around this issue? Or should I just do my own serialization layered on top of the SDK?

@RentierM -

This sounds like a bug. Could you create an NCBC and attach and example project with the steps to recreate? If you create the ticket yourself, you’ll be alerted of changes in the state of the ticket so that you can track progress. You can create the ticket here:



I have also found this bug and describe it here:

It is on the Upsert Methods on the CouchbaseBucket class.
It creates a new instance of Set which does not pass the buckets transcoder which is configured with your custom settings (serialisation/deserialisation settings).

Hence it defaults to the default transcoder with the CamelCasePropertyNamesContractResolver.

Guess I fall into same issue too.

Adding the reference to the issue here too: