Changes in formatting of .json files

Hello. I created some apps using javascript and html. These apps use XMLHttpRequest to get information from eve’s swagger api .json files such as https://esi.tech.ccp.is/latest/markets/prices/?datasource=tranquility and https://esi.tech.ccp.is/v3/universe/systems/30001414/?datasource=tranquility&language=en-us. I create arrays from these files splitting them up to disect the information and utilize it in my app. Recently, the formatting of these files was changed, rearranging the information, such as typeID’s for some things used to be at position [0] in my array and are now at position [2]. I had to go go through all of my xml files and compare my code to the swagger api’s .json files and fix what had become broken due to these changes. So my questions are as follows: Why were these changes made? Can I expect similar changes to be made going forward? Are there patch notes published somewhere that I should be reading to keep track of changes made to the API?

Thanks,
Maverick Togenada

If you use the /vx/ instead of the /latest/ they wont break on you like that. However if an endpoint gets too old it will start returning deprecated headers with the responses. Can keep an eye on the changelog to have an idea of what to expect.

EDIT: Oh wait you were talking about the order of the keys, im not sure that is guaranteed, probably be better of with like an array of objects like the response is?

Thanks! The changelog itself answers the questions I asked. You have also pointed me in the right direction to fix my code. I’m going to change my app to get the keys by name instead of their position in the array. It seems that the position is something that is subject to change. For example; When I first started this, I saw that type ID was the first key in an object and just assumed that would always be true, so I made an array and proceeded to grab the type ID from [0] in the array. Now I will just iterate through the array to find where the type ID is store currently.

Thanks again,
Maverick Togenada

If you aren’t doing anything special with the responses, why not just save the JSON response and use that directly vs iterating thru and making your own?

I think that would work up to a point, for things like system and item id’s but once I start using those values to find things like “system kills” which is updated every hour, or market prices which I assume are regularly updated, I need to get the most recent data.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.