/**
* Filter collection parameters for the posts controller.
* @param array $query_params JSON Schema-formatted collection parameters
* @param WP_Post_Type $post_type Post type object.
*/
add_filter('rest_product_collection_params', function ($query_params, $post_type) {
$query_params['per_page']['maximum'] = 1000;
return $query_params;
}, 10, 2);