WordPress at a glance
function is not described

rest_validate_request_arg() WP 4.7.0

Validate a request argument based on details registered to the route.

No Hooks.

Return

WP_Error/true/false.

Usage

rest_validate_request_arg( $value, $request, $param );
$value(mixed) (required)
$request(WP_REST_Request) (required)
$param(string) (required)

Code of rest validate request arg: wp-includes/rest-api.php VER 5.1.1

<?php
function rest_validate_request_arg( $value, $request, $param ) {
	$attributes = $request->get_attributes();
	if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {
		return true;
	}
	$args = $attributes['args'][ $param ];

	return rest_validate_value_from_schema( $value, $args, $param );
}