[wp-trac] [WordPress Trac] #50300: Multi type on args properties returning invalid error message when not validated

WordPress Trac noreply at wordpress.org
Fri Jun 5 14:01:11 UTC 2020


#50300: Multi type on args properties returning invalid error message when not
validated
-------------------------------------------------+-------------------------
 Reporter:  pentatonicfunk                       |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.5
Component:  REST API                             |     Version:  5.3
 Severity:  normal                               |  Resolution:
 Keywords:  json-schema needs-patch needs-unit-  |     Focuses:  rest-api
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by pentatonicfunk):

 This could be tricky to solve since `rest_validate_value_from_schema` have
 multiple responsibilities and multiple exits.
 I wonder if this can be solved by break it down into smaller functions,
 also considering this function tend to get bigger once we add more
 validation args, such as new formats that recently added `min/maxLength`
 and `pattern`.

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


More information about the wp-trac mailing list