jenkins-bot has submitted this change and it was merged. ( 
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(-)

Approvals:
  jenkins-bot: Verified
  Mholloway: Looks good to me, approved



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: merged
Gerrit-Change-Id: I705ddd3debad9c1934ef93015663a7e24c0032a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ReadingLists
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to