You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem including expected versus actual behavior:
similar to #8149
Error with deserialization when using this construction.
"filtered_categories", new FiltersAggregation
{
Filters = new Buckets<Query>(categoryCodes.ToDictionary(
y => y,
x => (Query)new TermQuery(new Field("Categories")) { Value = x }))
}
Here the exception
Elastic.Transport.UnexpectedTransportException: The JSON value could not be converted to System.Collections.Generic.IReadOnlyCollection1[Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket]. Path: $.buckets | LineNumber: 0 | BytePositionInLine: 12. ---> System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.IReadOnlyCollection1[Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket]. Path: $.buckets | LineNumber: 0 | BytePositionInLine: 12.
at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.Deserialize(Utf8JsonReader& reader, ReadStack& state) at System.Text.Json.JsonSerializer.Read[TValue](Utf8JsonReader& reader, JsonTypeInfo1 jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](Utf8JsonReader& reader, JsonSerializerOptions options)
at Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(Utf8JsonReader& reader, JsonSerializerOptions options, Dictionary2 dictionary, String name) in /_/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs:line 263 at Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) in /_/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs:line 130 at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.ContinueDeserialize(ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack) at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.DeserializeAsync(Stream utf8Json, CancellationToken cancellationToken)
at Elastic.Transport.DefaultResponseBuilder1.SetBodyCoreAsync[TResponse](Boolean isAsync, ApiCallDetails details, RequestData requestData, Stream responseStream, String mimeType, CancellationToken cancellationToken) at Elastic.Transport.DefaultResponseBuilder1.ToResponseAsync[TResponse](RequestData requestData, Exception ex, Nullable1 statusCode, Dictionary2 headers, Stream responseStream, String mimeType, Int64 contentLength, IReadOnlyDictionary2 threadPoolStats, IReadOnlyDictionary2 tcpStats, CancellationToken cancellationToken)
at Elastic.Transport.HttpRequestInvoker.RequestCoreAsync[TResponse](Boolean isAsync, RequestData requestData, CancellationToken cancellationToken)
at Elastic.Transport.DefaultRequestPipeline1.CallProductEndpointCoreAsync[TResponse](Boolean isAsync, RequestData requestData, CancellationToken cancellationToken) at Elastic.Transport.DistributedTransport1.RequestCoreAsync[TResponse](Boolean isAsync, HttpMethod method, String path, PostData data, RequestParameters requestParameters, OpenTelemetryData openTelemetryData, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Elastic.Transport.DistributedTransport1.ThrowUnexpectedTransportException[TResponse](Exception killerException, List1 seenExceptions, RequestData requestData, TResponse response, RequestPipeline pipeline)
at Elastic.Transport.DistributedTransport1.RequestCoreAsync[TResponse](Boolean isAsync, HttpMethod method, String path, PostData data, RequestParameters requestParameters, OpenTelemetryData openTelemetryData, CancellationToken cancellationToken) at Elastic.Clients.Elasticsearch.ElasticsearchClient.<>c__DisplayClass28_03.<g__SendRequest|0>d.MoveNext() in /_/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient.cs:line 158
Steps to reproduce:
1.
2.
3.
Expected behavior
A clear and concise description of what you expected to happen.
Provide ConnectionSettings (if relevant):
Provide DebugInformation (if relevant):
The text was updated successfully, but these errors were encountered:
8.15.0:
8.8.0:
.NET 8:
Mac OS 14.1.1 (23B81):
Description of the problem including expected versus actual behavior:
similar to #8149
Error with deserialization when using this construction.
Here the exception
Elastic.Transport.UnexpectedTransportException: The JSON value could not be converted to System.Collections.Generic.IReadOnlyCollection
1[Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket]. Path: $.buckets | LineNumber: 0 | BytePositionInLine: 12. ---> System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.IReadOnlyCollection
1[Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket]. Path: $.buckets | LineNumber: 0 | BytePositionInLine: 12.at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
at System.Text.Json.Serialization.JsonCollectionConverter
2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)at System.Text.Json.Serialization.Metadata.JsonPropertyInfo
1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter
1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)at System.Text.Json.Serialization.Metadata.JsonTypeInfo
1.Deserialize(Utf8JsonReader& reader, ReadStack& state) at System.Text.Json.JsonSerializer.Read[TValue](Utf8JsonReader& reader, JsonTypeInfo
1 jsonTypeInfo)at System.Text.Json.JsonSerializer.Deserialize[TValue](Utf8JsonReader& reader, JsonSerializerOptions options)
at Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(Utf8JsonReader& reader, JsonSerializerOptions options, Dictionary
2 dictionary, String name) in /_/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs:line 263 at Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) in /_/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs:line 130 at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)at System.Text.Json.Serialization.Metadata.JsonPropertyInfo
1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter
1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)at System.Text.Json.Serialization.Metadata.JsonTypeInfo
1.ContinueDeserialize(ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack) at System.Text.Json.Serialization.Metadata.JsonTypeInfo
1.DeserializeAsync(Stream utf8Json, CancellationToken cancellationToken)at Elastic.Transport.DefaultResponseBuilder
1.SetBodyCoreAsync[TResponse](Boolean isAsync, ApiCallDetails details, RequestData requestData, Stream responseStream, String mimeType, CancellationToken cancellationToken) at Elastic.Transport.DefaultResponseBuilder
1.ToResponseAsync[TResponse](RequestData requestData, Exception ex, Nullable1 statusCode, Dictionary
2 headers, Stream responseStream, String mimeType, Int64 contentLength, IReadOnlyDictionary2 threadPoolStats, IReadOnlyDictionary
2 tcpStats, CancellationToken cancellationToken)at Elastic.Transport.HttpRequestInvoker.RequestCoreAsync[TResponse](Boolean isAsync, RequestData requestData, CancellationToken cancellationToken)
at Elastic.Transport.DefaultRequestPipeline
1.CallProductEndpointCoreAsync[TResponse](Boolean isAsync, RequestData requestData, CancellationToken cancellationToken) at Elastic.Transport.DistributedTransport
1.RequestCoreAsync[TResponse](Boolean isAsync, HttpMethod method, String path, PostData data, RequestParameters requestParameters, OpenTelemetryData openTelemetryData, CancellationToken cancellationToken)--- End of inner exception stack trace ---
at Elastic.Transport.DistributedTransport
1.ThrowUnexpectedTransportException[TResponse](Exception killerException, List
1 seenExceptions, RequestData requestData, TResponse response, RequestPipeline pipeline)at Elastic.Transport.DistributedTransport
1.RequestCoreAsync[TResponse](Boolean isAsync, HttpMethod method, String path, PostData data, RequestParameters requestParameters, OpenTelemetryData openTelemetryData, CancellationToken cancellationToken) at Elastic.Clients.Elasticsearch.ElasticsearchClient.<>c__DisplayClass28_0
3.<g__SendRequest|0>d.MoveNext() in /_/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient.cs:line 158Steps to reproduce:
1.
2.
3.
Expected behavior
A clear and concise description of what you expected to happen.
Provide
ConnectionSettings
(if relevant):Provide
DebugInformation
(if relevant):The text was updated successfully, but these errors were encountered: