while working on my other stuff, I found it a bit tedious to write all the API requests manually. Therefore I wrote a little helper tool that parses the API documentation page and creates a couple of classes that automagically create the correct request URL for all available filters at each resource. That means, if the API changes, simply run it again and you'll have a fresh set of Java classes with all the correct fields set and the description added as a javadoc comment.
It's just a quick'n'dirty hack to save some time, but maybe someone finds it useful.
I considered doing the same for the result fields of a request, but figured that it'll take too long to write each format implementation and come up with some elaborate testing to define the return types.
Feel free to modify the code to your needs or add support for more languages and remember to allow the application to contact http://api.giantbomb.com/documentation.
Edit: (Some usage info)
To use the classes, download the tool and run it using:
java -jar gb-api-parser.jar [DIRECTORY]
You can specify your preferred directory which will also set the default package name or leave it empty and it will default to gbapi.
After that, copy the results into your project src folder (you might have to adjust the package name manually).
Here is a simple example on how to use one of the classes:
GBApi api = new GBApi(); Search searchRes = api.new Search(); searchRes.setApi_key(_api_key); searchRes.setField_list("name,image,api_detail_url,site_detail_url"); searchRes.setFormat("jsonp"); searchRes.setJson_callback("callback"); searchRes.setOffset("10")); searchRes.setQuery("Stuff"); searchRes.setResources(resource);
String url = "http://api.giantbomb.com/search/" + searchRes.toUrl();
After that, use your preferred method of invoking the URL and handle the results.