[wp-trac] [WordPress Trac] #38420: API Post status parameter does not accept multiple values

WordPress Trac noreply at wordpress.org
Tue Nov 1 17:26:08 UTC 2016


#38420: API Post status parameter does not accept multiple values
--------------------------------------+------------------------------
 Reporter:  kadamwhite                |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  REST API                  |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------
Changes (by jnylen0):

 * keywords:   => has-patch has-unit-tests


Comment:

 > I added the `type` because I was not quite sure if there could be a list
 of integer enums

 I've kept this change, and also added the `type` parameter for all
 arguments in the namespace index responses because there is no other way
 to tell that the `status` parameter accepts a list of values when listing
 posts (in the item schema exposed by `?context=help`, `status` is just a
 string).  Note this is a larger change, but I think it is the right thing
 to do.

 I did not add the default enum validation from `38420.4.diff` ("Handle
 enum arrays") because this is a bit of a special case and it needs custom
 validation logic anyway.  I'm not sure if we should go ahead and add
 automatic enum array validation here or not.

 Since the last patch(es) I've also fixed this change for media handling,
 added all the tests I could think of, and ran through the logic on a
 couple of test sites.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38420#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list