[wp-trac] [WordPress Trac] #48818: REST API does not check nested required properties

WordPress Trac noreply at wordpress.org
Sat May 16 18:41:56 UTC 2020


#48818: REST API does not check nested required properties
--------------------------------------+--------------------------------
 Reporter:  TimothyBlynJacobs         |       Owner:  TimothyBlynJacobs
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  5.5
Component:  REST API                  |     Version:  4.9
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+--------------------------------
Changes (by TimothyBlynJacobs):

 * owner:  (none) => TimothyBlynJacobs
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"47809" 47809]:
 {{{
 #!CommitTicketReference repository="" revision="47809"
 REST API: Check required properties are provided when validating an
 object.

 Previously, the WP_REST_Request object validated that top-level properties
 were defined, but this did not extend to those object's required
 properties. This adds validation to rest_validate_value_from_schema()
 directly.

 Both the v3 and v4 JSON Schema syntax for required properties is
 supported.

 Props sorenbronsted.
 Fixes #48818.
 }}}

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


More information about the wp-trac mailing list