[wp-trac] [WordPress Trac] #51146: After upgrade to WordPress 5.5 I got an error on using REST api

WordPress Trac noreply at wordpress.org
Wed Aug 26 17:48:15 UTC 2020


#51146: After upgrade to WordPress 5.5  I got an error on using REST api
--------------------------+--------------------------------
 Reporter:  rtagliento    |       Owner:  TimothyBlynJacobs
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  5.5.1
Component:  REST API      |     Version:  5.5
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  rest-api
--------------------------+--------------------------------

Comment (by TimothyBlynJacobs):

 A question here is what should happen in the following case:

 `rest_validate_value_from_schema( '15.5', [ 'type' => ['integer',
 'string'] ] );`

 Right now this passes validation because `string` is an accepted value.
 Part of me wonders if we should reject it because it is a numeric string
 which could be cast to a real `float` type. And then be rejected because
 it isn't an integer. But the more that I think about it, I think adding
 that level of complexity to the juggling system probably wouldn't be worth
 it and might lead to more weird behavior.

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


More information about the wp-trac mailing list