I'm trying to change how Newtonsoft handles self referencing loops when using Nest to serialize an object. I'm using Newtonsoft.Json 4.5.11 and I'm stuck with that version, Nest is version 0.11.7.0 and the code snippet I'm using is
var searchBoxUri = new Uri("Url");
var elasticSettings = new ConnectionSettings(searchBoxUri)
.SetDefaultIndex("sample");
elasticSettings.SetJsonSerializerSettingsModifier(s => {
s.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
});
var client = new ElasticClient(elasticSettings);
client.Index(currentPage);
using this code I'm getting the following exception in the stack trace
[JsonSerializationException: Self referencing loop detected with type 'some type'.]
So, why does't the client use the settings I have configured or am I missing something here?
This is a bug in the 0.11.7.0 release following some heavy refactoring to make the serialization leaner.
See also https://github.com/Mpdreamz/NEST/pull/382
Will be fixed in 0.11.8/0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With