aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-05-09 09:30:43 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-05-09 09:30:43 +0200
commit008dcd97794317f200949b52fa1b5a6dd5fbb04d (patch)
treef411d51b172e7d37e9d753072e22773b9829ec49 /sonar-plugin-api
parent746294dc55e8b36dd210c6cefab19289191091b8 (diff)
downloadsonarqube-008dcd97794317f200949b52fa1b5a6dd5fbb04d.tar.gz
sonarqube-008dcd97794317f200949b52fa1b5a6dd5fbb04d.zip
SONAR-5111 Add missing format parameters
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/ws/RailsHandler.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/RailsHandler.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/RailsHandler.java
index 87f798b5250..9b0342574d6 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/RailsHandler.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/RailsHandler.java
@@ -38,4 +38,24 @@ public class RailsHandler implements RequestHandler {
throw new UnsupportedOperationException("This web service is implemented in rails");
}
+ public static WebService.NewParam addFormatParam(WebService.NewAction action) {
+ return action.createParam("format")
+ .setDescription("Response format can be set through:" +
+ "<ul>" +
+ "<li>Parameter format: xml | json</li>" +
+ "<li>Or the 'Accept' property in the HTTP header:" +
+ "<ul>" +
+ "<li>Accept:text/xml</li>" +
+ "<li>Accept:application/json</li>" +
+ "</ul></li></ul>" +
+ "If nothing is set, json is used")
+ .setPossibleValues("json", "xml");
+ }
+
+ public static WebService.NewParam addJsonOnlyFormatParam(WebService.NewAction action) {
+ return action.createParam("format")
+ .setDescription("Only json response format is available")
+ .setPossibleValues("json");
+ }
+
}