]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1036225: Return a link to the REST documentation in "method not found" errors
authorDavid Lawrence <dkl@mozilla.com>
Thu, 10 Jul 2014 16:18:01 +0000 (16:18 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Thu, 10 Jul 2014 16:18:01 +0000 (16:18 +0000)
r=glob,a=glob

Bugzilla/Constants.pm
Bugzilla/WebService/Server/REST.pm

index 74062df6301539ee9b23238e0bbe2686267f49b2..d22eed063c9026f6b9e532a83fcd41c6bd300e57 100644 (file)
@@ -18,6 +18,7 @@ use Memoize;
 
 @Bugzilla::Constants::EXPORT = qw(
     BUGZILLA_VERSION
+    REST_DOC
 
     REMOTE_FILE
     LOCAL_FILE
@@ -198,6 +199,10 @@ use Memoize;
 # Bugzilla version
 use constant BUGZILLA_VERSION => "4.5.4+";
 
+# A base link to the current REST Documentation. We place it here
+# as it will need to be updated to whatever the current release is.
+use constant REST_DOC => "http://www.bugzilla.org/docs/tip/en/html/api/";
+
 # Location of the remote and local XML files to track new releases.
 use constant REMOTE_FILE => 'http://updates.bugzilla.org/bugzilla-update.xml';
 use constant LOCAL_FILE  => 'bugzilla-update.xml'; # Relative to datadir.
index bdc8365fce1b2b39cdeee1dd03287e6cfc66c6c2..2f1b80c45d5f6bd2ba3c31093f0d3298818d7ef2 100644 (file)
@@ -120,6 +120,7 @@ sub response {
     if (exists $json_data->{error}) {
         $result = $json_data->{error};
         $result->{error} = $self->type('boolean', 1);
+        $result->{documentation} = REST_DOC;
         delete $result->{'name'}; # Remove JSONRPCError
     }
     elsif (exists $json_data->{result}) {