Opened 17 years ago
Closed 16 years ago
#4600 closed defect (bug) (invalid)
Codex documentation for WP extensions doesn't match actual behavior
Reported by: | redsweater | Owned by: | josephscott |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.2.1 |
Component: | XML-RPC | Keywords: | |
Focuses: | Cc: |
Description
I've noticed in implementing client support for the new WP extensions to the MovableType API, that there are some discrepancies between the documented structure types and the actual types returned/expected by the API.
In general, I expect that almost every instance of a struct element being identified as "int" should actually be identified as "string" (with a possible caveat that the value must be a numeric string).
Specifically I noticed that the struct response for wp.newCategory returns <string> elements for the comment ID and parent ID. This is consistent with MovableType's habit of using <string> for all the numeric parameter values.
I think it's a good idea to keep WordPress's current behavior, because it makes the struct typing very compatible with MovableType. But the Codex should be updated so as not to encourage clients to expect a different format than they'll receive.
Probably this will be a somewhat tedious task to do accurately, as it may require somebody pushing test requests through for all the documented methods and verifying that the request and response values should indeed be <string>. I would recommend doing this testing with an assumption towards them being <string>, because it seems exceedingly likely based on the observed behavior for wp.newCategory.
Where I said: "Specifically I noticed that the struct response for wp.newCategory returns <string> elements for the comment ID and parent ID."
I should have said it was the struct response for "wp.getCategories" - not "wp.newCategory" !