[wp-trac] [WordPress Trac] #54740: REST API: oneOf validation behaves unexpectedly with strings/arrays

WordPress Trac noreply at wordpress.org
Tue Jan 4 20:05:08 UTC 2022


#54740: REST API: oneOf validation behaves unexpectedly with strings/arrays
--------------------------+------------------------------
 Reporter:  ryelle        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  REST API      |     Version:  5.6
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by ryelle):

 [attachment:"54740.diff"] adds a (failing) test case for the `test_one_of`
 unit test, to show the error. The first added case fails, because the
 string matches both the string & array options. The last case also fails,
 when it should match neither, so I think there's a different type casting
 happening somewhere else.

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


More information about the wp-trac mailing list