Hi,

First off, nice work on the API :-) Nice structure, quite simple to extend.

I'm building an API module for the wikidata extension, which will basically provide an XML interface to wikidata terms. In doing so I ran into a couple of issues that I hope somebody on this list can help me with.

My first question is: how do I place an API module in an extension?

Wikidata has it's own branch, so I can simply put my API module and it's formatters in the includes/api directory and modify both  includes/api/ApiMain.php and includes/AutoLoader.php. But I'd much rather put my code in the Wikidata extension and not modify anything in the branch. I found an svn commit that suggests that this is possible, but I fail to see how.

My second question is: how can a custom printer learn about the format parameter passed in the request?

My module uses it's own formatter. I created one for several reasons, one being that I had trouble getting a big data structure into the ApiResult object. Maybe I just didn't understands the interface. That wasn't the only reason, I felt like I needed an different internal representation. Anyway, there's a nice hook for creating a custom printer: the getCustomPrinter method. But unfortunately that method doesn't get the value of the format parameter passed in. My module can format different types of output, but right now I have to solve this by adding my own format parameter (which gets prefixed with 'wd' for wikidata). Is there any way I can find out what that parameter was?

Many thanks,

Maarten
--
Maarten van Hoof
maarten.vanhoof@edia.nl

Edia - Educatie Technologie
Asterweg 19D12 | 1031 HL Amsterdam
T 020 716 36 12 | F 020 716 36 13 | M 06 245 392 15 | www.edia.nl