29 if ( $contentType !==
'application/json' ) {
32 [
'content_type' => $contentType ]
38 self::PARAM_SOURCE =>
'body',
39 ParamValidator::PARAM_TYPE =>
'string',
40 ParamValidator::PARAM_REQUIRED =>
true,
43 self::PARAM_SOURCE =>
'body',
44 ParamValidator::PARAM_TYPE =>
'string',
45 ParamValidator::PARAM_REQUIRED =>
true,
48 self::PARAM_SOURCE =>
'body',
49 ParamValidator::PARAM_TYPE =>
'string',
50 ParamValidator::PARAM_REQUIRED =>
true,
53 self::PARAM_SOURCE =>
'body',
54 ParamValidator::PARAM_TYPE =>
'string',
55 ParamValidator::PARAM_REQUIRED =>
false,
57 ] + $this->getTokenParamDefinition() );
68 $contentmodel = $body[
'content_model'] ?:
null;
70 if ( $contentmodel !==
null && !$this->contentHandlerFactory->isDefinedModel( $contentmodel ) ) {
72 new MessageValue(
'rest-bad-content-model', [ $body[
'content_model'] ] ), 400
76 $token = $this->getToken() ?? $this->
getUser()->getEditToken();
81 'text' => $body[
'source'],
82 'summary' => $body[
'comment'],
87 if ( $contentmodel !==
null ) {
88 $params[
'contentmodel'] = $contentmodel;
96 array $actionModuleResult,
99 parent::mapActionModuleResponse(
100 $actionModuleResponse,
108 $response->
setHeader(
'Location', $url );
Do-nothing body validator.
Allow programs to request this object from WebRequest::response() and handle all outputting (or lack ...