Make WordPress Core


Ignore:
Timestamp:
08/15/2020 04:09:56 PM (4 years ago)
Author:
TimothyBlynJacobs
Message:

REST API: Add uniqueItems as a permitted endpoint argument JSON Schema keyword.

Support for the uniqueItems keyword was added in [48357], but wasn't included in the list of permitted keywords for WP_REST_Controller::get_endpoint_args_for_item_schema(). This prevented the keyword from being automatically supported if specified in a controller's item schema.

Fixes #51021.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-controller.php

    r47923 r48796  
    266266        $this->assertArrayHasKey( 'items', $args['somearray'] );
    267267
    268         foreach ( array( 'minItems', 'maxItems' ) as $property ) {
     268        foreach ( array( 'minItems', 'maxItems', 'uniqueItems' ) as $property ) {
    269269            $this->assertArrayHasKey( $property, $args['somearray'] );
    270270        }
Note: See TracChangeset for help on using the changeset viewer.