MediaWiki REL1_35
MediaWiki\Rest\Validator\BodyValidator Interface Reference

Interface for validating a request body. More...

Inheritance diagram for MediaWiki\Rest\Validator\BodyValidator:

Public Member Functions

 validateBody (RequestInterface $request)
 Validate the body of a request.
 

Detailed Description

Interface for validating a request body.

Stable to implement

Definition at line 13 of file BodyValidator.php.

Member Function Documentation

◆ validateBody()

MediaWiki\Rest\Validator\BodyValidator::validateBody ( RequestInterface  $request)

Validate the body of a request.

This may return a data structure representing the parsed body. When used in the context of Handler::validateParams(), the returned value will be available to the handler via Handler::getValidatedBody().

Parameters
RequestInterface$request
Returns
mixed
Exceptions
HttpExceptionon validation failure

Implemented in MediaWiki\Rest\Validator\JsonBodyValidator, and MediaWiki\Rest\Validator\NullBodyValidator.


The documentation for this interface was generated from the following file: