Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator Class Reference

Can likely be removed once T305973 is done. More...

+ Inheritance diagram for Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator:
+ Collaboration diagram for Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator:

Public Member Functions

 __construct (array $settings)
 
 validateBody (RequestInterface $request)
 

Public Attributes

const TYPE_MISMATCH_CODE = 'invalid-request-body'
 
const TYPE_MISMATCH_MESSAGE = 'Invalid field type'
 

Private Member Functions

 hasExpectedType (string $fieldName, $fieldValue)
 
 isOptionalAndNull (string $fieldName, $fieldValue)
 
 getFieldTypeFromSettings (string $fieldName)
 

Private Attributes

 $settings
 

Detailed Description

Can likely be removed once T305973 is done.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator::__construct ( array  $settings)

Member Function Documentation

◆ getFieldTypeFromSettings()

Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator::getFieldTypeFromSettings ( string  $fieldName)
private

◆ hasExpectedType()

Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator::hasExpectedType ( string  $fieldName,
  $fieldValue 
)
private
Parameters
mixed$fieldValue

◆ isOptionalAndNull()

Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator::isOptionalAndNull ( string  $fieldName,
  $fieldValue 
)
private
Parameters
mixed$fieldValue

◆ validateBody()

Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator::validateBody ( RequestInterface  $request)

Member Data Documentation

◆ $settings

Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator::$settings
private

◆ TYPE_MISMATCH_CODE

const Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator::TYPE_MISMATCH_CODE = 'invalid-request-body'

◆ TYPE_MISMATCH_MESSAGE

const Wikibase\Repo\RestApi\RouteHandlers\TypeValidatingJsonBodyValidator::TYPE_MISMATCH_MESSAGE = 'Invalid field type'

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