Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serializerSettings with v3 client #550

Closed
coffeymatt opened this issue Jul 16, 2019 · 3 comments
Closed

serializerSettings with v3 client #550

coffeymatt opened this issue Jul 16, 2019 · 3 comments

Comments

@coffeymatt
Copy link

In the previous v2 version I could pass serializer settings to the client. With the new v3 client, it's not so clear how to do that

So I could do something like:

var serializerSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };

this.client = new DocumentClient(new Uri(this.options.CosmosDbEndPoint), this.options.CosmosDbKey, serializerSettings: serializerSettings);

How do I do this with v3? I've had a look at the docs and the API, I can see an options object with a serializer parameter on it, but I can't figure out how I could configure it as above?

@j82w
Copy link
Contributor

j82w commented Jul 16, 2019

@coffeymatt we removed settings and added the ability to have completely custom serializers in v3.

CosmosClientOptions.Serializer

This is the SDK's default serializer.

@j82w j82w closed this as completed Jul 16, 2019
@coffeymatt
Copy link
Author

@j82w This seems like one step forward, two steps backward. Should you not provide some mechanism to provide settings the default serializer?

Otherwise what I can do with one line of code above now will require me to create a custom serializer.

@j82w
Copy link
Contributor

j82w commented Jul 16, 2019

That's a good point. I don't see any reason that can't be supported. I created an issue to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants