-
#7272 Support custom JsonSerializerOptions.
DynamicTemplate
forms part of the TypeMapping
object, included on GetIndexRespone
.
-
The type for the
Mapping
property has changed fromElastic.Clients.Elasticsearch.Properties
toElastic.Clients.Elasticsearch.IProperty
. This breaking change fixes an error introduced by the code-generator. Before introducing this fix, the type could not correctly deserialize responses for GET index requests and prevented dynamic templates from being configured for indices via PUT index.
Before
public sealed partial class DynamicTemplate
{
...
public Elastic.Clients.Elasticsearch.Mapping.Properties? Mapping { get; set; }
...
}
After
public sealed partial class DynamicTemplate
{
...
public Elastic.Clients.Elasticsearch.Mapping.IProperty? Mapping { get; set; }
...
}
Among other uses, TypeMapping
forms part of the GetIndexRespone
.
-
The
DynamicTemplates
property has been simplified to make it easier to work with and to fix deserialization failures on certain responses. Rather than use aUnion
to describe the fact that this property may be a single dictionary of dynamic templates, or an array of dictionaries, this is now code-generated as a specialised single or many collection. The API exposes this as anICollection
of dictionaries and the JSON converter is able to handle either an array or individual dictionary in responses.
Before
public sealed partial class TypeMapping
{
...
public Union<IDictionary<string, Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate>?, ICollection<IDictionary<string, Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate>>?>? DynamicTemplates { get; set; }
...
}
After
public sealed partial class TypeMapping
{
...
public ICollection<IDictionary<string, Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate>>? DynamicTemplates { get; set; }
...
}
The SystemTextJsonSerializer
is used as a base type for the built-in serializers. Two breaking changes have been made after adding better support for customizing source serialization.
The public Options
property has been made internal.
A new public abstract method CreateJsonSerializerOptions
has been added, which derived types must implement.
protected abstract JsonSerializerOptions CreateJsonSerializerOptions();