Automattic\WooCommerce\StoreApi\Routes\V1\Ucp

CatalogSearch::get_request_args │ protected │ WC 1.0

Request body arguments accepted by this route.

Bounds the UCP contract names its own error codes for (query length, price range) stay in the handler, so the response carries those codes rather than rest_invalid_param.

Method of the class: CatalogSearch{}

No Hooks.

Returns

array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_request_args(): array;

CatalogSearch::get_request_args() code WC 11.3.0

protected function get_request_args(): array {
	return array_merge(
		parent::get_request_args(),
		array(
			'query'      => array(
				'description' => __( 'Free-text search query.', 'woocommerce' ),
				'type'        => 'string',
			),
			'filters'    => array(
				'description' => __( 'Filter criteria to narrow search results.', 'woocommerce' ),
				'type'        => 'object',
			),
			'pagination' => array(
				'description' => __( 'Requested page size and cursor.', 'woocommerce' ),
				'type'        => 'object',
			),
		)
	);
}