diff --git a/commercetools.Sdk/Tests/commercetools.Api.Serialization.Tests/ProductSearchDeserializationTest.cs b/commercetools.Sdk/Tests/commercetools.Api.Serialization.Tests/ProductSearchDeserializationTest.cs index 622e295dc38..ec5d9a547d5 100644 --- a/commercetools.Sdk/Tests/commercetools.Api.Serialization.Tests/ProductSearchDeserializationTest.cs +++ b/commercetools.Sdk/Tests/commercetools.Api.Serialization.Tests/ProductSearchDeserializationTest.cs @@ -1,6 +1,5 @@ using System.IO; using commercetools.Sdk.Api.Models.ProductSearches; -using FluentAssertions; using Xunit; namespace commercetools.Api.Serialization.Tests @@ -29,9 +28,9 @@ public void FacetDeserialization() var count = Assert.IsAssignableFrom(facets[1]); Assert.Equal("supplierCounts", count.Name); Assert.Equal(10, count.Value); - + var serialize = serializerService.Serialize(deserialized); - + Assert.Equal("{\"total\":0,\"offset\":0,\"limit\":0,\"facets\":[{\"name\":\"supplierName\",\"buckets\":[{\"key\":\"Example Inc.\",\"count\":77}]},{\"name\":\"supplierCounts\",\"value\":10}]}", serialize); } } diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Serialization/JsonConverters/ProductSearchFacetConverter.cs b/commercetools.Sdk/commercetools.Sdk.Api/Serialization/JsonConverters/ProductSearchFacetConverter.cs index beb15f56f17..38a3cbe538f 100644 --- a/commercetools.Sdk/commercetools.Sdk.Api/Serialization/JsonConverters/ProductSearchFacetConverter.cs +++ b/commercetools.Sdk/commercetools.Sdk.Api/Serialization/JsonConverters/ProductSearchFacetConverter.cs @@ -3,10 +3,7 @@ using System.Text.Json.Serialization; using commercetools.Sdk.Api.Models.Products; using commercetools.Base.Serialization; -using commercetools.Base.Serialization.MapperTypeRetrievers; using commercetools.Sdk.Api.Models.ProductSearches; -using commercetools.Sdk.Api.Serialization.MapperTypeRetrievers; -using Attribute = commercetools.Sdk.Api.Models.Products.Attribute; using Type = System.Type; namespace commercetools.Sdk.Api.Serialization.JsonConverters @@ -69,7 +66,8 @@ public override void Write(Utf8JsonWriter writer, IProductSearchFacetResult valu writer.WritePropertyName("buckets"); JsonSerializer.Serialize(writer, bucket.Buckets, options); } - else if (value is ProductSearchFacetResultCount count) { + else if (value is ProductSearchFacetResultCount count) + { writer.WritePropertyName("value"); JsonSerializer.Serialize(writer, count.Value, options); } diff --git a/reference.txt b/reference.txt new file mode 100644 index 00000000000..d661f8563bb --- /dev/null +++ b/reference.txt @@ -0,0 +1 @@ +0be69283d6aba9d3a2f895140378673f2f80f7b0 diff --git a/references.txt b/references.txt index d319b48db3b..7fec4d05416 100644 --- a/references.txt +++ b/references.txt @@ -293,3 +293,4 @@ c8c2455221baca20421082b7715eaa0a712af7f1 41774e015e4f946bd57f0e2dc76522ed757860c4 d410bad973f2fe90ea8239c4cb586fe0cfc13856 6bb8d35316a92441d0a59417b49ad3a8c7037e45 +605a1ff5cf861ca0d8e2711ca79374804f180b50