modio/modio-sdk-legacy

Allow requesting just a certain set of fields for a query.

leper opened this issue · 4 comments

leper commented

It would be nice if one could specify what parts of the "full" response one actually wants and thus not needing to transfer data that will not be used at all.

Currently we do a query curl --request GET 'https://api.mod.io/v1/games?api_key=use_your_own&nameid=0ad' and the only thing we actually care about in the response is "id": 57.

There are similar things for the other query curl --request GET 'https://api.mod.io/v1/games/57/mods?api_key=acf8fc07e3a8e9228ef4d5704c1659a1' (not the actual code, but equivalent, and easier to test), where we currently only need "name", "nameid", "summary", and "modfile": {"version", "filename", "filehash", "filesize", "download"} for each entry. All the other data is not really needed and it would be nicer if we could specify that when doing the query.

Depending on the infrastructure used this might also remove some ultimately unneccessary work the server has to do.

This was originally on the list of features. I agree that it is smarter in the sense that it only returns the exact fields that are required, my concern was it would affect the consistency of the responses and consumers of the API perhaps may have parameters set unintentionally and not getting back the described object by the documentation. This will not be a breaking change if added so I'll keep it on the table on the time-being and investigate potentially implementing it shortly.

@leper
Can you send me an email at pat@dbolical.com please - we have made some changes to the API and I wanted to give you the full changelog.

leper commented

Done. Though I guess having public API changelogs would be great for all users of the API.

Once the site launches publically - this information will be posted on our blog and elsewhere. That will be early 2018.