Nithanim / gw2api

A library that provides access to the api of Guild Wars 2.
Apache License 2.0
5 stars 1 forks source link

api.recipes().get().getIngredients() retrieves BasicItem with id -1 #22

Closed oziiii closed 5 years ago

oziiii commented 5 years ago

I'm using gw2api-0.0.6. When getting recipe's items, API returns array of BasicItem with correct count but without item IDs. GuildWars2Api api = new GuildWars2Api(); Arrays.stream(api.recipes().get(1703).getIngredients()).forEach((BasicItem bi) -> System.out.println("id=" + bi.getId() + ", count=" + bi.getCount())); gives me: id=-1, count=8 id=-1, count=1 id=-1, count=2 id=-1, count=5

Nithanim commented 5 years ago

Thank you very much for your detailed report! It seems that this has been broken ever since and nobody noticed or told me.

I have created a fix and uploaded version 0.0.7. It is not particularly pretty but it required me to update gson to allow for both id and item_id to be handled. In the same process the .jar is now Java 8 and I hope this is not an issue for you.

I just made a quick check with your recipe and a generic item query but I did not go any further. Please tell me if I broke something else in the process

oziiii commented 5 years ago

Now it works like a charm! Thank you so much for fast response :)

Nithanim commented 5 years ago

Absolutely no problem! Please let me know if you encounter any further problem.