21 '@phan-var array $body';
22 return $body[
'title'];
32 self::PARAM_SOURCE =>
'body',
33 ParamValidator::PARAM_TYPE =>
'string',
34 ParamValidator::PARAM_REQUIRED =>
true,
35 self::PARAM_DESCRIPTION =>
'The intended content of the page',
38 self::PARAM_SOURCE =>
'body',
39 ParamValidator::PARAM_TYPE =>
'string',
40 ParamValidator::PARAM_REQUIRED =>
true,
41 self::PARAM_DESCRIPTION =>
'The title of the page to create',
44 self::PARAM_SOURCE =>
'body',
45 ParamValidator::PARAM_TYPE =>
'string',
46 ParamValidator::PARAM_REQUIRED =>
true,
47 self::PARAM_DESCRIPTION =>
'A comment descripting the reason for creating the page',
50 self::PARAM_SOURCE =>
'body',
51 ParamValidator::PARAM_TYPE =>
'string',
52 ParamValidator::PARAM_REQUIRED =>
false,
53 self::PARAM_DESCRIPTION =>
'The content model to use to interpret the source',
57 + parent::getParamSettings();
65 '@phan-var array $body';
69 $contentmodel = $body[
'content_model'] ?:
null;
71 if ( $contentmodel !==
null && !$this->contentHandlerFactory->isDefinedModel( $contentmodel ) ) {
73 new MessageValue(
'rest-bad-content-model', [ $body[
'content_model'] ] ), 400
84 'text' => $body[
'source'],
85 'summary' => $body[
'comment'],
90 if ( $contentmodel !==
null ) {
91 $params[
'contentmodel'] = $contentmodel;
99 array $actionModuleResult,
102 parent::mapActionModuleResponse(
103 $actionModuleResponse,
108 $title = $this->
urlEncodeTitle( $actionModuleResult[
'edit'][
'title'] );
110 $url = $this->
getRouter()->getRouteUrl(
'/v1/page/' . $title );
111 $response->
setHeader(
'Location', $url );
array $params
The job parameters.