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
in #3869 we added a new field to the RenderingContent model, however it contained some typos in the syntax causing the banners to not be treated like a list.
//// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.//usingSystem;usingSystem.Text;usingSystem.Linq;usingSystem.Text.Json.Serialization;usingSystem.Collections.Generic;usingAlgolia.Search.Serializer;usingSystem.Text.Json;namespaceAlgolia.Search.Models.Search;/// <summary>/// widgets returned from any rules that are applied to the current search./// </summary>publicpartialclassWidgets{/// <summary>/// Initializes a new instance of the Widgets class./// </summary>publicWidgets(){}/// <summary>/// Gets or Sets Banners/// </summary>[JsonPropertyName("banners")]publicBannersBanners{get;set;}// this is where the issue is, this should be a list of type banner/// <summary>/// Returns the string presentation of the object/// </summary>/// <returns>String presentation of the object</returns>publicoverridestringToString(){StringBuildersb=newStringBuilder();sb.Append("class Widgets {\n");sb.Append(" Banners: ").Append(Banners).Append("\n");sb.Append("}\n");returnsb.ToString();}/// <summary>/// Returns the JSON string presentation of the object/// </summary>/// <returns>JSON string presentation of the object</returns>publicvirtualstringToJson(){returnJsonSerializer.Serialize(this,JsonConfig.Options);}/// <summary>/// Returns true if objects are equal/// </summary>/// <param name="obj">Object to be compared</param>/// <returns>Boolean</returns>publicoverrideboolEquals(objectobj){if(objis not Widgetsinput){returnfalse;}return(Banners==input.Banners||(Banners!=null&&Banners.Equals(input.Banners)));}/// <summary>/// Gets the hash code/// </summary>/// <returns>Hash code</returns>publicoverrideintGetHashCode(){unchecked// Overflow is fine, just wrap{inthashCode=41;if(Banners!=null){hashCode=(hashCode*59)+Banners.GetHashCode();}returnhashCode;}}}
Its the same case for the urls in the BannerImage.cs, it should be a list of strings.
Language
CSharp
Client
Search
Steps to reproduce
Go to the merchandising studio and create a rule that should return a banner for a given query
Execute the query you specified in step 1 through the .NET client
The client will fail to deserialize the json response from the api
Relevant log output
Algolia.Search.Exceptions.AlgoliaException: Error while deserializing response of type Algolia.Search.Models.Search.SearchResponses`1[Komplett.Integrations.SearchEngine.AlgoliaIndexedProductDto] ---> System.IO.InvalidDataException: The JSON string cannot be deserialized into any schema defined. at Algolia.Search.Models.Search.SearchResultJsonConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
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.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.DeserializeAsObject(Utf8JsonReader& reader, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpanAsObject(ReadOnlySpan`1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable`1 actualByteCount)
at System.Text.Json.JsonSerializer.ReadFromSpanAsObject(ReadOnlySpan`1 json, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options) at Algolia.Search.Serializer.DefaultJsonSerializer.Deserialize(Stream response, Type type) --- End of inner exception stack trace --- at Algolia.Search.Serializer.DefaultJsonSerializer.Deserialize(Stream response, Type type) at Algolia.Search.Serializer.DefaultJsonSerializer.Deserialize[T](Stream response) at Algolia.Search.Transport.HttpTransport.ExecuteRequestAsync[TResult,TData](HttpMethod method, String uri, InternalRequestOptions requestOptions, CancellationToken ct) at Algolia.Search.Transport.HttpTransport.ExecuteRequestAsync[TResult](HttpMethod method, String uri, InternalRequestOptions requestOptions, CancellationToken ct) at Algolia.Search.Clients.SearchClient.SearchAsync[T](SearchMethodParams searchMethodParams, RequestOptions options, CancellationToken cancellationToken)
Self-service
I'd be willing to fix this bug myself.
The text was updated successfully, but these errors were encountered:
@millotp this is related to the changes introduced in #3869, i have not been able to set up this repo on my local machine so i cant run this and actually confirm that it works but i think its as simple as altering the syntax slightly on the bannerImageUrl like this:
bannerImageUrl:
description: url for a search banner image.
type: array
items:
type: string
additionalProperties: false
and also update the banners syntax:
banners:
description: banners defined in the merchandising studio for the given search.
type: array
items:
$ref: '#/banner'
additionalProperties: false
but you would have to build the project to confirm that its the only issue
Description
in #3869 we added a new field to the RenderingContent model, however it contained some typos in the syntax causing the banners to not be treated like a list.
Response from api:
However the model that is genered in the csharp client looks like this:
Its the same case for the urls in the BannerImage.cs, it should be a list of strings.
Language
CSharp
Client
Search
Steps to reproduce
Relevant log output
Self-service
The text was updated successfully, but these errors were encountered: