wiki.techinc.nl/includes/Rest/Validator/NullBodyValidator.php
Brad Jorsch ebfbd2d42a rest: Use ParamValidator library, add BodyValidator
Parameter validation is based on parameter definitions like those in the
Action API, using the new ParamValidator library. Handlers should use
the provided Handler methods to access parameters rather than fetching
them directly from the RequestInterface.

Body validation allows the handler to have the (non-form-data) body of a
request parsed and validated. The only validator included in this patch
ignores the body entirely; future patches may implement validation for
JSON bodies based on JSON schemas, or the like.

Bug: T223239
Change-Id: I3c37ea2b432840514b6bff90007c8403989225d5
2019-09-04 10:12:35 -04:00

16 lines
253 B
PHP

<?php
namespace MediaWiki\Rest\Validator;
use MediaWiki\Rest\RequestInterface;
/**
* Do-nothing body validator
*/
class NullBodyValidator implements BodyValidator {
public function validateBody( RequestInterface $request ) {
return null;
}
}