These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

[CREST] Suggested Format for Market Groups Endpoint

Author
xPhyrax
Petrolinvest
#1 - 2015-03-16 03:14:33 UTC
I know CREST is still undergoing development but I wanted to put my two cents in here. For what it's worth, I'm writing a little thingy for my own personal use and found that the market/groups endpoint is just... OMG to work with.

So here's my reasoning, followed by my current json format after I pass the endpoint through my script:

  • Drop href for each item, and key each group by its actual key ( a number )
  • Drop types, if you key by the actual group #, you leave it up to the developer
  • Nest the groups appropriately ( like I have in my example ), or add a parent key with it's associated ID instead of using parentGroup.href



Side note: in my example, I have the 'children' key for my purpose only, that could just be dropped in favor of a regular object notation.

If anyone would like to walk through my code and see how I'm re-formatting the data, you can do that by checking the GitHub repo for my current project: https://github.com/JayWood/eve-market-importer

So, here's the format I propose for the endpoint, would really appreciate some feedback form CCP, or even an explanation of the reason keys currently exist: https://gist.github.com/JayWood/7f6025d4feea193ae3f3
Aineko Macx
#2 - 2015-03-16 09:21:49 UTC
CREST has many problems, but it seems CCP will rather strive for RESTfulness than for consumer usability / utility.
Pete Butcher
The Scope
Gallente Federation
#3 - 2015-03-16 10:15:50 UTC
CREST seems to try to follow HATEOAS (or at least I got that impression), but fails at certain points. But I think (hope) things will get ironed out with time and everybody will be happy.

http://evernus.com - the ultimate multiplatform EVE trade tool + nullsec Alliance Market tool

xPhyrax
Petrolinvest
#4 - 2015-03-16 13:22:01 UTC
Overall, I just didn't see the point of using hrefs. I mean, why wouldn't we just use IDs instead. I guess, I'm just frustrated at myself that I completely forgot how to write a recursion method originally, which made this end point an overall pain to traverse.
Pete Butcher
The Scope
Gallente Federation
#5 - 2015-03-16 13:27:05 UTC
xPhyrax wrote:
Overall, I just didn't see the point of using hrefs. I mean, why wouldn't we just use IDs instead. I guess, I'm just frustrated at myself that I completely forgot how to write a recursion method originally, which made this end point an overall pain to traverse.


The point is - if you don't know the resources and/or actions, HATEOAS is a good thing. But if you do, and in EVE we do given the SDE and XML API, using hrefs just makes things unnecessary complex. IMHO, current CREST implementation is a textbook example of overengineering, where the 80/20 principle applies - 20% use cases make 80% other use cases a pain. I would really love a versioned WADL API.

http://evernus.com - the ultimate multiplatform EVE trade tool + nullsec Alliance Market tool