MediaWiki master
MediaWiki\Rest\Validator\JsonBodyValidator Class Reference

Do-nothing body validator. More...

Inherits MediaWiki\Rest\Validator\BodyValidator.

Collaboration diagram for MediaWiki\Rest\Validator\JsonBodyValidator:

Public Member Functions

 __construct (array $bodyParamSettings)
 
 getOpenAPISpec ()
 Returns an OpenAPI Schema Object specification structure as an associative array.
 
 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|null
Exceptions
HttpExceptionon validation failure

 

Detailed Description

Do-nothing body validator.

Definition at line 16 of file JsonBodyValidator.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\Validator\JsonBodyValidator::__construct ( array $bodyParamSettings)
Parameters
array[]$bodyParamSettings

Definition at line 26 of file JsonBodyValidator.php.

Member Function Documentation

◆ getOpenAPISpec()

MediaWiki\Rest\Validator\JsonBodyValidator::getOpenAPISpec ( )

Returns an OpenAPI Schema Object specification structure as an associative array.

See also
https://swagger.io/specification/#schema-object

This will contain information about the supported parameters.

Returns
array

Definition at line 88 of file JsonBodyValidator.php.

References MediaWiki\Rest\Validator\Validator\getParameterSpec().

◆ validateBody()

MediaWiki\Rest\Validator\JsonBodyValidator::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|null
Exceptions
HttpExceptionon validation failure

Returns
array

Implements MediaWiki\Rest\Validator\BodyValidator.

Definition at line 34 of file JsonBodyValidator.php.

References MediaWiki\Rest\RequestInterface\getBody().


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