modio-sdk-legacy icon indicating copy to clipboard operation
modio-sdk-legacy copied to clipboard

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

Open leper opened this issue 8 years ago • 4 comments

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.

leper avatar Nov 21 '17 02:11 leper

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.

Patskimoto avatar Nov 22 '17 04:11 Patskimoto

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

Patskimoto avatar Nov 24 '17 00:11 Patskimoto

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

leper avatar Nov 24 '17 00:11 leper

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

intenscia avatar Nov 24 '17 00:11 intenscia