Closed JAYDEV-DE closed 6 years ago
Thanks for reporting the issue. I'll look into it tonight.
Looks like this is actually an issue with Manatee.Json trying to serialize a nullable enum. I'll create an issue over there.
@JAYDEV-DE please download Manatee.Json v9.6.1 (available on Nuget soon). This should resolve the problem.
@gregsdennis Awesome, that was really quick, i appreciate that.
I tested the code snipped, all works fine now - thanks :-)
Hello,
first of all: Thank you for providing this project, it saved me a lot of time so far.
The issue appears after setting the CheckItem.State to "CheckItemState.Complete".
Here the Exception details:
I'm using a brand new clone of this repository.
Error-Class: "Manatee.Trello.ManateeJson.GeneralExtensions" Error-Function: "public static void Serialize(this T obj, JsonObject json, JsonSerializer serializer, string key, bool force = false)"
Error-Details:"System.ArgumentException occurred HResult=0x80070057 Message=Type provided must be an Enum. Parameter name: enumType Source=mscorlib StackTrace: at System.RuntimeType.GetEnumValues() at System.Enum.GetValues(Type enumType) at Manatee.Json.Serialization.Internal.Serializers.EnumNameSerializer._EnsureDescriptions[T]() at Manatee.Json.Serialization.Internal.Serializers.EnumNameSerializer.Serialize[T](T obj, JsonSerializer serializer) at Manatee.Json.Serialization.Internal.Serializers.DefaultValueSerializer.Serialize[T](T obj, JsonSerializer serializer) at Manatee.Json.Serialization.Internal.Serializers.SchemaValidator.Serialize[T](T obj, JsonSerializer serializer) at Manatee.Json.Serialization.JsonSerializer.Serialize[T](T obj) at Manatee.Trello.ManateeJson.GeneralExtensions.Serialize[T](T obj, JsonObject json, JsonSerializer serializer, String key, Boolean force) in C:\Users\Jansen\Documents\Development\TrelloConnector\Manatee.Trello-master\Manatee.Trello.ManateeJson\GeneralExtensions.cs:line 26 at Manatee.Trello.ManateeJson.Entities.ManateeCheckItem.ToJson(JsonSerializer serializer) in C:\Users\Jansen\Documents\Development\TrelloConnector\Manatee.Trello-master\Manatee.Trello.ManateeJson\Entities\ManateeCheckItem.cs:line 29 at Manatee.Json.Serialization.Internal.Serializers.JsonSerializableSerializer.Serialize[T](T obj, JsonSerializer serializer) at Manatee.Json.Serialization.Internal.Serializers.ReferencingSerializer.Serialize[T](T obj, JsonSerializer serializer) at Manatee.Json.Serialization.Internal.Serializers.DefaultValueSerializer.Serialize[T](T obj, JsonSerializer serializer) at Manatee.Json.Serialization.Internal.Serializers.SchemaValidator.Serialize[T](T obj, JsonSerializer serializer) at Manatee.Json.Serialization.JsonSerializer.Serialize[T](T obj)"
It can be reproduced with the following lines of code:
` var serializer = new ManateeSerializer(); TrelloConfiguration.Serializer = serializer; TrelloConfiguration.Deserializer = serializer; TrelloConfiguration.JsonFactory = new ManateeFactory(); TrelloConfiguration.RestClientProvider = new WebApiClientProvider(); TrelloAuthorization.Default.AppKey = "";
TrelloAuthorization.Default.UserToken = "";
`
Hope someone can help me fixing this problem.
Thanks
Julian