diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.Converters.g.cs index 23e370065e3..ef116adf70f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.Converters.g.cs @@ -54,7 +54,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.Hit Read(re LocalJsonValue>?> propHighlight = default; LocalJsonValue propId = default; LocalJsonValue?> propIgnored = default; - LocalJsonValue>?> propIgnoredFieldValues = default; + LocalJsonValue>?> propIgnoredFieldValues = default; LocalJsonValue propIndex = default; LocalJsonValue?> propInnerHits = default; LocalJsonValue, System.Collections.Generic.IReadOnlyDictionary>?> propMatchedQueries = default; @@ -96,7 +96,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.Hit Read(re continue; } - if (propIgnoredFieldValues.TryReadProperty(ref reader, options, PropIgnoredFieldValues, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + if (propIgnoredFieldValues.TryReadProperty(ref reader, options, PropIgnoredFieldValues, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!))) { continue; } @@ -214,7 +214,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropHighlight, value.Highlight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropId, value.Id, null, null); writer.WriteProperty(options, PropIgnored, value.Ignored, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIgnoredFieldValues, value.IgnoredFieldValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropIgnoredFieldValues, value.IgnoredFieldValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); writer.WriteProperty(options, PropIndex, value.Index, null, null); writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteProperty(options, PropMatchedQueries, value.MatchedQueries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteUnionValue, System.Collections.Generic.IReadOnlyDictionary>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs index 20459980869..10a4384e069 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs @@ -58,7 +58,7 @@ internal Hit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel #endif string Id { get; set; } public System.Collections.Generic.IReadOnlyCollection? Ignored { get; set; } - public System.Collections.Generic.IReadOnlyDictionary>? IgnoredFieldValues { get; set; } + public System.Collections.Generic.IReadOnlyDictionary>? IgnoredFieldValues { get; set; } public #if NET7_0_OR_GREATER required diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.Converters.g.cs index 5a4ed0a403e..38906d92455 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.Converters.g.cs @@ -37,7 +37,17 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermQuery Read(ref System reader.Read(); propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); reader.Read(); - var readerSnapshot = reader; + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.TermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Value = value + }; + } + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propBoost = default; LocalJsonValue propCaseInsensitive = default; @@ -65,20 +75,13 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermQuery Read(ref System continue; } - try + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { - reader = readerSnapshot; - var result = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.QueryDsl.TermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Value = result - }; - } - catch (System.Text.Json.JsonException) - { - throw; + reader.Skip(); + continue; } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);