3 namespace MediaWiki\Rest\Validator
;
5 use MediaWiki\Rest\HttpException
;
6 use MediaWiki\Rest\RequestInterface
;
9 * Interface for validating a request body
11 interface BodyValidator
{
14 * Validate the body of a request.
16 * This may return a data structure representing the parsed body. When used
17 * in the context of Handler::validateParams(), the returned value will be
18 * available to the handler via Handler::getValidatedBody().
20 * @param RequestInterface $request
22 * @throws HttpException on validation failure
24 public function validateBody( RequestInterface
$request );