[wp-xmlrpc] Re: metaWeblog.getCategories, not returning struct of structs, problem?

Dougal Campbell dougal at gunters.org
Fri Nov 9 15:44:55 GMT 2007


Joseph Scott wrote:
>
> We've got a ticket from earlier this year about metaWeblog.getCategories:
>
>     http://trac.wordpress.org/ticket/3994
>
> The complaint is that we aren't following the spec:
>
>     http://www.xmlrpc.com/metaWeblogApi
>
> which says that it shall return a struct of structs.  I've confirmed
> that what WP does in return an array of structs, which is what the
> author of the ticket wants changed.
>
> I've not been approached by any client vendors to change this to match
> the standard, indeed this ticket is the only mention that I've seen of
> it.  Dougal may have some history to add to this though.
>
> Are any of the XML-RPC vendors that work with WordPress concerned
> about this?  Given the sometimes fragile of these types of things that
> have been around for awhile I'm inclined to leave things they way they
> are and close this

I'm willing to bet that this is just a case where the vagueness of the
spec (and lack of good examples) caused us to mis-implement. The
category portion of the post struct is an array, so it probably seemed
natural that getCategories should, as well.

I suggest that we try converting to a struct, and test the major clients
against it to see if anything breaks. If everything still works, then we
fix it, otherwise, it probably needs to be a 'wontfix'.
 
So, the question is, what is the 'name' portion of the parent struct
going to be? The category name, category slug, or category ID? I'm
leaning towards slug, especially since we already have the ID and name
in the data portion of the struct. However, I'm guessing that the
original intent was to use the category name as the key. Other
considerations to think about: the spec obviously assumes a flat
category space, but we have hierarchical. Should we try to account for
that? I know we're already sending extra info about that in the data
portion of the category structs, but that's not part of the spec either,
and we want to be able to handle naive clients.


-- 
Dougal Campbell <dougal at gunters.org <mailto:dougal at gunters.org>>
http://dougal.gunters.org/ <http://dougal.gunters.org>


More information about the wp-xmlrpc mailing list