-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
catrope@svn.wikimedia.org wrote:
Revision: 35081 Author: catrope Date: 2008-05-20 09:16:01 +0000 (Tue, 20 May 2008)
Log Message:
Unified aiprop and iiprop somewhat by adding iiprop=mime and
Woohoo!
Hmm, I do notice though...
In order to get any particular property, I have to ask for it explicitly. But if I ask for any property the server doesn't recognize, the whole request gets rejected with an error message:
"code": "iiunknown_iiprop", "info": "Unrecognised value for parameter 'iiprop'",
This isn't very friendly to progressive enhancement / graceful degredation.
For instance, I might want to be able to use both foreign repos that are running 1.12 (in which case I have to guess MIME type on my end) *and* those running 1.13 (in which case I can get the type from the server).
The simplest way would be to say "give me the mime type, if you've got it" and if I don't get it back, just interpolate it and use all the rest of the data.
But since I don't get *any* data back when I do this, I'd have to jump through some hoops:
* Try with mime, then when it fails try a second request without -- high overhead to connect to old versions unless we cache the failover information.
* Request a list of supported properties from the server -- I'm unclear on whether this is even available. Again, we'd have to cache that info to get efficient queries.
* Require the site admin to specify the remote server's support when configuring the repo -- extra administrative overhead, and won't get the enhancement when the foreign site is upgraded.
- -- brion vibber (brion @ wikimedia.org)
Brion Vibber schreef:
Woohoo! Hmm, I do notice though...
In order to get any particular property, I have to ask for it explicitly. But if I ask for any property the server doesn't recognize, the whole request gets rejected with an error message:
"code": "iiunknown_iiprop", "info": "Unrecognised value for parameter 'iiprop'",
This isn't very friendly to progressive enhancement / graceful degredation.
It's probably a good thing to at least mention which property was unrecognized, and probably even better to completely ignore unknown properties. I'll work on that.
- Request a list of supported properties from the server -- I'm unclear
on whether this is even available. Again, we'd have to cache that info to get efficient queries.
Yes there is, action=paraminfo.
Roan Kattouw (Catrope)
Roan said:
It's probably a good thing to at least mention which property was unrecognized, and probably even better to completely ignore unknown properties. I'll work on that.
If possible, you may want to consider sending back some kind of dataset which gives the values requested which were able to be fulfilled AND reports any which were not. That way a smart client could tell the difference between an improperly passed query (missing params) and a properly formed query, some of whose properties are merely unrecognized.
Of course, I'm no expert on the API and I don't know the details of the return type, so my opinion may not count for much. :)
-- Jim R. Wilson (jimbojw)
On Tue, May 20, 2008 at 1:43 PM, Roan Kattouw roan.kattouw@home.nl wrote:
Brion Vibber schreef:
Woohoo! Hmm, I do notice though...
In order to get any particular property, I have to ask for it explicitly. But if I ask for any property the server doesn't recognize, the whole request gets rejected with an error message:
"code": "iiunknown_iiprop", "info": "Unrecognised value for parameter 'iiprop'",
This isn't very friendly to progressive enhancement / graceful degredation.
It's probably a good thing to at least mention which property was unrecognized, and probably even better to completely ignore unknown properties. I'll work on that.
- Request a list of supported properties from the server -- I'm unclear
on whether this is even available. Again, we'd have to cache that info to get efficient queries.
Yes there is, action=paraminfo.
Roan Kattouw (Catrope)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Jim R. Wilson schreef:
If possible, you may want to consider sending back some kind of dataset which gives the values requested which were able to be fulfilled AND reports any which were not. That way a smart client could tell the difference between an improperly passed query (missing params) and a properly formed query, some of whose properties are merely unrecognized.
I don't think that's necessary. You know how to form a request (because it's documented all over the place and can be retrieved through action=paraminfo), you know what you asked for and you notice when what you asked for is not there. That should be enough information to determine where the cause lies (you or the API version).
Roan Kattouw (Catrope)
I'm also thinking of the case where someone misspells a param and they can't figure out why the darned thing isn't returning anything for "iprop" (banging head on keyboard all the while)
But hey - that's just my $0.02 - do as you like :)
-- Jim
On Tue, May 20, 2008 at 1:58 PM, Roan Kattouw roan.kattouw@home.nl wrote:
Jim R. Wilson schreef:
If possible, you may want to consider sending back some kind of dataset which gives the values requested which were able to be fulfilled AND reports any which were not. That way a smart client could tell the difference between an improperly passed query (missing params) and a properly formed query, some of whose properties are merely unrecognized.
I don't think that's necessary. You know how to form a request (because it's documented all over the place and can be retrieved through action=paraminfo), you know what you asked for and you notice when what you asked for is not there. That should be enough information to determine where the cause lies (you or the API version).
Roan Kattouw (Catrope)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Jim R. Wilson schreef:
I'm also thinking of the case where someone misspells a param and they can't figure out why the darned thing isn't returning anything for "iprop" (banging head on keyboard all the while)
But hey - that's just my $0.02 - do as you like :)
-- Jim
That's not handled right now. Rather than parsing the parameters one by one, the API checks for parameters when it needs them. If it needs inprop, it'll look for inprop, not find it, and use the default. iprop will just be ignored as no one will ever query it. Stuff like inprop=tokn will throw the warning "unrecognized value for 'inprop': token", though. For more details, see the post on mediawiki-api I'll make in about 5 minutes.
Roan Kattouw (Catrope)
wikitech-l@lists.wikimedia.org