From 55a9bdbc11c99d875f517dc1d27a5960c56387ca Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 9 Jun 2020 19:35:31 -0300 Subject: [PATCH] Fixed missing 'items' in collection params (https://github.com/woocommerce/woocommerce-admin/pull/4484) --- .../src/API/Reports/Customers/Controller.php | 15 +++++++++++++++ .../API/Reports/Customers/Stats/Controller.php | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/plugins/woocommerce-admin/src/API/Reports/Customers/Controller.php b/plugins/woocommerce-admin/src/API/Reports/Customers/Controller.php index aa4c8b08d3c..3fc3b36e034 100644 --- a/plugins/woocommerce-admin/src/API/Reports/Customers/Controller.php +++ b/plugins/woocommerce-admin/src/API/Reports/Customers/Controller.php @@ -474,6 +474,9 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf 'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ), + 'items' => array( + 'type' => 'string', + ), ); $params['registered_before'] = array( 'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ), @@ -491,6 +494,9 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf 'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ), + 'items' => array( + 'type' => 'string', + ), ); $params['orders_count_min'] = array( 'description' => __( 'Limit response to objects with an order count greater than or equal to given integer.', 'woocommerce-admin' ), @@ -508,6 +514,9 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf 'description' => __( 'Limit response to objects with an order count between two given integers.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ), + 'items' => array( + 'type' => 'integer', + ), ); $params['total_spend_min'] = array( 'description' => __( 'Limit response to objects with a total order spend greater than or equal to given number.', 'woocommerce-admin' ), @@ -523,6 +532,9 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf 'description' => __( 'Limit response to objects with a total order spend between two given numbers.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ), + 'items' => array( + 'type' => 'integer', + ), ); $params['avg_order_value_min'] = array( 'description' => __( 'Limit response to objects with an average order spend greater than or equal to given number.', 'woocommerce-admin' ), @@ -538,6 +550,9 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf 'description' => __( 'Limit response to objects with an average order spend between two given numbers.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ), + 'items' => array( + 'type' => 'integer', + ), ); $params['last_order_before'] = array( 'description' => __( 'Limit response to objects with last order before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ), diff --git a/plugins/woocommerce-admin/src/API/Reports/Customers/Stats/Controller.php b/plugins/woocommerce-admin/src/API/Reports/Customers/Stats/Controller.php index d0cc62542ec..850ff64a0a9 100644 --- a/plugins/woocommerce-admin/src/API/Reports/Customers/Stats/Controller.php +++ b/plugins/woocommerce-admin/src/API/Reports/Customers/Stats/Controller.php @@ -277,6 +277,9 @@ class Controller extends \WC_REST_Reports_Controller { 'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ), + 'items' => array( + 'type' => 'string', + ), ); $params['registered_before'] = array( 'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ), @@ -294,6 +297,9 @@ class Controller extends \WC_REST_Reports_Controller { 'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ), + 'items' => array( + 'type' => 'string', + ), ); $params['orders_count_min'] = array( 'description' => __( 'Limit response to objects with an order count greater than or equal to given integer.', 'woocommerce-admin' ), @@ -311,6 +317,9 @@ class Controller extends \WC_REST_Reports_Controller { 'description' => __( 'Limit response to objects with an order count between two given integers.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ), + 'items' => array( + 'type' => 'integer', + ), ); $params['total_spend_min'] = array( 'description' => __( 'Limit response to objects with a total order spend greater than or equal to given number.', 'woocommerce-admin' ), @@ -326,6 +335,9 @@ class Controller extends \WC_REST_Reports_Controller { 'description' => __( 'Limit response to objects with a total order spend between two given numbers.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ), + 'items' => array( + 'type' => 'integer', + ), ); $params['avg_order_value_min'] = array( 'description' => __( 'Limit response to objects with an average order spend greater than or equal to given number.', 'woocommerce-admin' ), @@ -341,6 +353,9 @@ class Controller extends \WC_REST_Reports_Controller { 'description' => __( 'Limit response to objects with an average order spend between two given numbers.', 'woocommerce-admin' ), 'type' => 'array', 'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ), + 'items' => array( + 'type' => 'integer', + ), ); $params['last_order_before'] = array( 'description' => __( 'Limit response to objects with last order before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),