19 private $bodyParamSettings;
25 $this->bodyParamSettings = $bodyParamSettings;
29 $jsonStream = $request->
getBody();
32 if ( !$status->isOK() ) {
34 new MessageValue(
'rest-json-body-parse-error', [
"$status" ] ),
39 $data = $status->value;
41 if ( !is_array( $data ) ) {
45 foreach ( $this->bodyParamSettings as $name => $settings ) {
48 new MessageValue(
'rest-missing-body-field', [ $name ] ), 400
52 if ( !isset( $data[$name] ) ) {
Do-nothing body validator.
__construct(array $bodyParamSettings)
validateBody(RequestInterface $request)
Validate the body of a request.
Interface for validating a request body.