Gergő Tisza has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/390940 )
Change subject: Expose length limits to API
......................................................................
Expose length limits to API
Change-Id: I705ddd3debad9c1934ef93015663a7e24c0032a4
Depends-On: I2e784972d7e11cad79fdef887bbcde297dbd9ce0
---
M src/Api/ApiReadingListsCreate.php
M src/Api/ApiReadingListsCreateEntry.php
M src/Api/ApiReadingListsUpdate.php
3 files changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ReadingLists
refs/changes/40/390940/1
diff --git a/src/Api/ApiReadingListsCreate.php
b/src/Api/ApiReadingListsCreate.php
index 50dab69..f4f9925 100644
--- a/src/Api/ApiReadingListsCreate.php
+++ b/src/Api/ApiReadingListsCreate.php
@@ -3,6 +3,7 @@
namespace MediaWiki\Extensions\ReadingLists\Api;
use ApiBase;
+use MediaWiki\Extensions\ReadingLists\ReadingListRepository;
use Message;
/**
@@ -38,22 +39,27 @@
'name' => [
self::PARAM_TYPE => 'string',
self::PARAM_REQUIRED => true,
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_name'],
],
'description' => [
self::PARAM_TYPE => 'string',
self::PARAM_DFLT => '',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_description'],
],
'color' => [
self::PARAM_TYPE => 'string',
self::PARAM_DFLT => '',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_color'],
],
'image' => [
self::PARAM_TYPE => 'string',
self::PARAM_DFLT => '',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_image'],
],
'icon' => [
self::PARAM_TYPE => 'string',
self::PARAM_DFLT => '',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_icon'],
],
];
}
diff --git a/src/Api/ApiReadingListsCreateEntry.php
b/src/Api/ApiReadingListsCreateEntry.php
index c98a837..8221f97 100644
--- a/src/Api/ApiReadingListsCreateEntry.php
+++ b/src/Api/ApiReadingListsCreateEntry.php
@@ -3,6 +3,7 @@
namespace MediaWiki\Extensions\ReadingLists\Api;
use ApiBase;
+use MediaWiki\Extensions\ReadingLists\ReadingListRepository;
use Message;
use Title;
@@ -55,10 +56,12 @@
'project' => [
self::PARAM_TYPE => 'string',
self::PARAM_REQUIRED => true,
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rle_project'],
],
'title' => [
self::PARAM_TYPE => 'string',
self::PARAM_REQUIRED => true,
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rle_title'],
],
];
}
diff --git a/src/Api/ApiReadingListsUpdate.php
b/src/Api/ApiReadingListsUpdate.php
index 8c65e9d..8c81f3d 100644
--- a/src/Api/ApiReadingListsUpdate.php
+++ b/src/Api/ApiReadingListsUpdate.php
@@ -3,6 +3,7 @@
namespace MediaWiki\Extensions\ReadingLists\Api;
use ApiBase;
+use MediaWiki\Extensions\ReadingLists\ReadingListRepository;
/**
* API module for all write operations.
@@ -40,18 +41,23 @@
],
'name' => [
self::PARAM_TYPE => 'string',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_name'],
],
'description' => [
self::PARAM_TYPE => 'string',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_description'],
],
'color' => [
self::PARAM_TYPE => 'string',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_color'],
],
'image' => [
self::PARAM_TYPE => 'string',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_image'],
],
'icon' => [
self::PARAM_TYPE => 'string',
+ self::PARAM_MAX_BYTES =>
ReadingListRepository::$fieldLength['rl_icon'],
],
];
}
--
To view, visit https://gerrit.wikimedia.org/r/390940
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I705ddd3debad9c1934ef93015663a7e24c0032a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ReadingLists
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits