Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #20 from enrique-avalon/issue/19
Browse files Browse the repository at this point in the history
Issue/19
  • Loading branch information
pardahlman authored Aug 3, 2017
2 parents ae4c9e0 + bb816ee commit 1970046
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Akeneo/Serialization/AttributeBaseConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ public class AttributeBaseConverter : JsonConverter
private static readonly Type Attribute = typeof(AttributeBase);
private const string AttributeTypeProp = "type";
private static readonly JsonSerializer SnakeCaseSerialzer =
new JsonSerializer {ContractResolver = AkeneoSerializerSettings.AkeneoContractResolver};
new JsonSerializer
{
ContractResolver = AkeneoSerializerSettings.AkeneoContractResolver,
NullValueHandling = NullValueHandling.Ignore
};

public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Akeneo/Serialization/ProductValueDataConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
}
if (array.First.Type == JTokenType.String)
{
return array.ToObject<List<string>>();
return array.ToObject<List<string>>(serializer);
}
if (array.First.Type == JTokenType.Object)
{
return array.ToObject<List<PriceProductValue>>();
return array.ToObject<List<PriceProductValue>>(serializer);
}
return serializer.Deserialize<List<PriceProductValue>>(reader);
}
Expand Down

0 comments on commit 1970046

Please sign in to comment.