Skip to content

Commit 59f8977

Browse files
authored
[8.19] Regenerate client (#8715)
1 parent cb4ebb8 commit 59f8977

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.Converters.g.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.Hit<TDocument> Read(re
5454
LocalJsonValue<System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<string>>?> propHighlight = default;
5555
LocalJsonValue<string> propId = default;
5656
LocalJsonValue<System.Collections.Generic.IReadOnlyCollection<string>?> propIgnored = default;
57-
LocalJsonValue<System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.FieldValue>>?> propIgnoredFieldValues = default;
57+
LocalJsonValue<System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<object>>?> propIgnoredFieldValues = default;
5858
LocalJsonValue<string> propIndex = default;
5959
LocalJsonValue<System.Collections.Generic.IReadOnlyDictionary<string, Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult>?> propInnerHits = default;
6060
LocalJsonValue<Elastic.Clients.Elasticsearch.Union<System.Collections.Generic.IReadOnlyCollection<string>, System.Collections.Generic.IReadOnlyDictionary<string, double>>?> propMatchedQueries = default;
@@ -96,7 +96,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.Hit<TDocument> Read(re
9696
continue;
9797
}
9898

99-
if (propIgnoredFieldValues.TryReadProperty(ref reader, options, PropIgnoredFieldValues, static System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.FieldValue>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue<string, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.FieldValue>>(o, null, static System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.FieldValue> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<Elastic.Clients.Elasticsearch.FieldValue>(o, null)!)))
99+
if (propIgnoredFieldValues.TryReadProperty(ref reader, options, PropIgnoredFieldValues, static System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<object>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue<string, System.Collections.Generic.IReadOnlyCollection<object>>(o, null, static System.Collections.Generic.IReadOnlyCollection<object> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<object>(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx<object>(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker<object>))!)!)))
100100
{
101101
continue;
102102
}
@@ -214,7 +214,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
214214
writer.WriteProperty(options, PropHighlight, value.Highlight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<string>>? v) => w.WriteDictionaryValue<string, System.Collections.Generic.IReadOnlyCollection<string>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection<string> v) => w.WriteCollectionValue<string>(o, v, null)));
215215
writer.WriteProperty(options, PropId, value.Id, null, null);
216216
writer.WriteProperty(options, PropIgnored, value.Ignored, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection<string>? v) => w.WriteCollectionValue<string>(o, v, null));
217-
writer.WriteProperty(options, PropIgnoredFieldValues, value.IgnoredFieldValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.FieldValue>>? v) => w.WriteDictionaryValue<string, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.FieldValue>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.FieldValue> v) => w.WriteCollectionValue<Elastic.Clients.Elasticsearch.FieldValue>(o, v, null)));
217+
writer.WriteProperty(options, PropIgnoredFieldValues, value.IgnoredFieldValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<object>>? v) => w.WriteDictionaryValue<string, System.Collections.Generic.IReadOnlyCollection<object>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection<object> v) => w.WriteCollectionValue<object>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx<object>(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker<object>)))));
218218
writer.WriteProperty(options, PropIndex, value.Index, null, null);
219219
writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary<string, Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult>? v) => w.WriteDictionaryValue<string, Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult>(o, v, null, null));
220220
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.IReadOnlyCollection<string>, System.Collections.Generic.IReadOnlyDictionary<string, double>>? v) => w.WriteUnionValue<System.Collections.Generic.IReadOnlyCollection<string>, System.Collections.Generic.IReadOnlyDictionary<string, double>>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection<string> v) => w.WriteCollectionValue<string>(o, v, null), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary<string, double> v) => w.WriteDictionaryValue<string, double>(o, v, null, null)));

src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ internal Hit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel
5858
#endif
5959
string Id { get; set; }
6060
public System.Collections.Generic.IReadOnlyCollection<string>? Ignored { get; set; }
61-
public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<Elastic.Clients.Elasticsearch.FieldValue>>? IgnoredFieldValues { get; set; }
61+
public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyCollection<object>>? IgnoredFieldValues { get; set; }
6262
public
6363
#if NET7_0_OR_GREATER
6464
required

src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.Converters.g.cs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermQuery Read(ref System
3737
reader.Read();
3838
propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName<Elastic.Clients.Elasticsearch.Field>(o));
3939
reader.Read();
40-
var readerSnapshot = reader;
40+
if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject)
41+
{
42+
var value = reader.ReadValue<Elastic.Clients.Elasticsearch.FieldValue>(options, null);
43+
reader.Read();
44+
return new Elastic.Clients.Elasticsearch.QueryDsl.TermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
45+
{
46+
Field = propField.Value,
47+
Value = value
48+
};
49+
}
50+
4151
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
4252
LocalJsonValue<float?> propBoost = default;
4353
LocalJsonValue<bool?> propCaseInsensitive = default;
@@ -65,20 +75,13 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermQuery Read(ref System
6575
continue;
6676
}
6777

68-
try
78+
if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip)
6979
{
70-
reader = readerSnapshot;
71-
var result = reader.ReadValue<Elastic.Clients.Elasticsearch.FieldValue>(options, null);
72-
return new Elastic.Clients.Elasticsearch.QueryDsl.TermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
73-
{
74-
Field = propField.Value,
75-
Value = result
76-
};
77-
}
78-
catch (System.Text.Json.JsonException)
79-
{
80-
throw;
80+
reader.Skip();
81+
continue;
8182
}
83+
84+
throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'.");
8285
}
8386

8487
reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);

0 commit comments

Comments
 (0)