REST API: Support the (min|max)Items JSON Schema keywords.

A future commit will add support for the uniqueItems keyword.

Props sorenbronsted.
See #48821.


git-svn-id: https://develop.svn.wordpress.org/trunk@47923 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Timothy Jacobs
2020-06-07 22:40:16 +00:00
parent d3387a2161
commit f5dde31290
5 changed files with 58 additions and 3 deletions
@@ -265,6 +265,10 @@ class WP_Test_REST_Controller extends WP_Test_REST_TestCase {
$this->assertArrayHasKey( 'items', $args['somearray'] );
foreach ( array( 'minItems', 'maxItems' ) as $property ) {
$this->assertArrayHasKey( $property, $args['somearray'] );
}
foreach ( array( 'properties', 'additionalProperties' ) as $property ) {
$this->assertArrayHasKey( $property, $args['someobject'] );
}