diff options
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/ws/RailsHandler.java | 20 |
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"); + } + } |