[wp-trac] [WordPress Trac] #38531: Support for arrays in schema validation and sanitization

WordPress Trac noreply at wordpress.org
Wed Nov 9 18:26:55 UTC 2016


#38531: Support for arrays in schema validation and sanitization
-------------------------+-----------------------
 Reporter:  joehoyle     |       Owner:  joehoyle
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  4.7
Component:  REST API     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |     Focuses:
-------------------------+-----------------------

Comment (by jnylen0):

 > I believe the default behaviour here is correct.

 In that case, we should probably add an item type to the few array
 args/properties that don't have one:

 {{{
 array arg without item type:
   /wp/v2/posts
   slug
   {"required":false,"description":"Limit result set to posts with one or
 more specific slugs.","type":"array"}

 array arg without item type:
   /wp/v2/pages
   slug
   {"required":false,"description":"Limit result set to posts with one or
 more specific slugs.","type":"array"}

 array arg without item type:
   /wp/v2/media
   slug
   {"required":false,"description":"Limit result set to posts with one or
 more specific slugs.","type":"array"}

 array property in schema without item type:
   /wp/v2/taxonomies
   capabilities
   {"description":"All capabilities used by the
 resource.","type":"array","context":["edit"],"readonly":true}

 array property in schema without item type:
   /wp/v2/taxonomies/(?P<taxonomy>[\w-]+)
   capabilities
   {"description":"All capabilities used by the
 resource.","type":"array","context":["edit"],"readonly":true}
 }}}

 Source: https://gist.github.com/nylen/9021f6d19157a023a0a8a607a3adb28a

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


More information about the wp-trac mailing list