Make WordPress Core

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's profile redsweater Owned by: josephscott's profile 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.

Change History (5)

#1 @josephscott
17 years ago

  • Owner changed from anonymous to josephscott

#2 @redsweater
17 years ago

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" !

#3 @foolswisdom
17 years ago

  • Milestone set to 2.4 (future)

#4 @darkdragon
16 years ago

Recommend fixing the codex and closing this out.

I would have to say that you have to be liberal with input and conservative with output. If crap is wrong, then fix it on your end. It might actually be right.

#5 @jacobsantos
16 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Whatever real world implementation WordPress has should be considered the authoritative word and not the Codex.

Note: See TracTickets for help on using tickets.