MediaWiki master
MediaWiki\Rest\Validator\JsonBodyValidator Class Reference

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

Deprecated
since 1.43, return body properties from Handler::getParamSettings().

Definition at line 16 of file JsonBodyValidator.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\Validator\JsonBodyValidator::__construct ( array $bodyParamSettings)
Deprecated
since 1.43, Return body parameters from getBodyParamSettings() instead.
Parameters
array[]$bodyParamSettings

Definition at line 27 of file JsonBodyValidator.php.

References wfDeprecatedMsg().

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 93 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 39 of file JsonBodyValidator.php.

References MediaWiki\Rest\RequestInterface\getBody().


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