From 7acf45d41f7017cf8e293402214d91e70e8d7515 Mon Sep 17 00:00:00 2001 From: "bzrmirror%bugzilla.org" Date: Thu, 10 Jul 2014 16:30:58 +0000 Subject: [PATCH] Bug 1036225: Return a link to the REST documentation in "method not found" errors r=glob,a=glob git-svn-id: svn://10.0.0.236/trunk@265458 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/.gitrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Constants.pm | 5 +++++ mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index ec96e3785b8..6ea2457cb72 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -9081 \ No newline at end of file +9082 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.gitrev b/mozilla/webtools/bugzilla/.gitrev index f4ccda895d4..e6437e8554e 100644 --- a/mozilla/webtools/bugzilla/.gitrev +++ b/mozilla/webtools/bugzilla/.gitrev @@ -1 +1 @@ -8dbd57d5cb91bdc1ab6f13018c2ca1163dddef82 \ No newline at end of file +551eb6d2f6ed6da115b3ab51a966628ac445e29f \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Constants.pm b/mozilla/webtools/bugzilla/Bugzilla/Constants.pm index 74062df6301..d22eed063c9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Constants.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Constants.pm @@ -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. diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm index bdc8365fce1..2f1b80c45d5 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm @@ -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}) {