Guild emblem ids string or numbers?
Yay, my guild is famous!
I’m pretty sure this is not intended. In fact, there have been patches which turned numerical strings into actual numbers in other endpoints (items for example).
In Java you should be able to use Integer.parseInt("" + i). This way it should convert strings to ints and not cause errors if i is already an integer.
Guild Emblem Editor: http://nailek.net/gw2/emblemeditor
Thx I’ve been doing Java since ’98, parseInt() is not the issue.
The issue is that invoking jsonObject.getInt(<id>) in JSON-P raises a ClassCastException because, due to this change, the value stored for those accessors in the JsonObject is of type JsonValue.STRING instead of JsonValue.NUMBER. Thus jsonObject.getString(<id>) or jsonObject.getJsonString(<id>) needs to be called instead and then the value needs to be parsed. And, if I do the change preemptively, and later the API switches back to numbers instead of strings, I will get ClassCastException instead for the very same reason.
(edited by JaxomNC.5381)
Before I attempt to fix anything and use string instances all over the place: is this an intended change? Is this supposed to be permanent or is this something that was overlooked? What about other API endpoints which used to have numbers/integers for ids?
This is a bug. I changed some backend pieces around and this somehow slipped through the cracks; I’ll try to get this fixed on live today.
This should be fixed on live.
Thx, it’s working ok again now.