Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string to RenderUrl error? #12

Closed
StealthyXor opened this issue Aug 12, 2019 · 1 comment
Closed

string to RenderUrl error? #12

StealthyXor opened this issue Aug 12, 2019 · 1 comment
Labels
Area: Web API v2 Related to the v2 web API Duration: Medium Between 2 and 8 hours of estimated work Priority: Medium Medium priority Resolution: Fixed The issue has been fixed Type: Bug Something isn't working

Comments

@StealthyXor
Copy link

StealthyXor commented Aug 12, 2019

var ids = webApiClient.Items.IdsAsync().Result;
var items = webApiClient.Items.ManyAsync(ids).Result;

exception occurs on GW2Sharp.Json.Converters.CastableTypeConverter

var targetType = objectType.GetCustomAttributes<CastableTypeAttribute>().FirstOrDefault(a => a.Value.Equals(type.ParseEnum(a.Value.GetType())))?.ObjectType;
            return targetType == null ? jObject.ToObject(objectType) : jObject.ToObject(targetType, serializer);

where:
targetType = null
and error message is:

Newtonsoft.Json.JsonSerializationException
HResult=0x80131500
Message=Error converting value "https://render.guildwars2.com/file/1F6D9A6B9C0E4975DFA5404A4D23D5DFF407154C/1766347.png" to type 'Gw2Sharp.WebApi.RenderUrl'. Path 'icon'.
Source=Newtonsoft.Json
StackTrace:
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
at Gw2Sharp.Json.Converters.CastableTypeConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in C:\Users\steal\source\repos\Gw2Sharp\Gw2Sharp\Json\Converters\CastableTypeConverter.cs:line 33
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)

Inner Exception 1:
ArgumentException: Could not cast or convert from System.String to Gw2Sharp.WebApi.RenderUrl.

@StealthyXor StealthyXor changed the title struct RenderUrl to string string to RenderUrl error? Aug 12, 2019
@Archomeda Archomeda added Area: Web API v2 Related to the v2 web API Duration: Medium Between 2 and 8 hours of estimated work Priority: Medium Medium priority Status: In progress This is being worked on Type: Bug Something isn't working labels Aug 12, 2019
@Archomeda Archomeda added Resolution: Fixed The issue has been fixed and removed Status: In progress This is being worked on labels Aug 12, 2019
@Archomeda
Copy link
Owner

Thanks for reporting! The fix will be included in the next release: v0.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Web API v2 Related to the v2 web API Duration: Medium Between 2 and 8 hours of estimated work Priority: Medium Medium priority Resolution: Fixed The issue has been fixed Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants