}
private void defineIndexAction(NewController controller) {
- controller.createAction("index")
+ WebService.NewAction action = controller.createAction("index")
.setDescription("Documentation of this web service is available <a href=\"http://redirect.sonarsource.com/doc/old-web-service-api.html\">here</a>")
.setResponseExample(getClass().getResource("events-index-example.json"))
.setSince("2.6")
.setHandler(RailsHandler.INSTANCE);
+ RailsHandler.addFormatParam(action);
}
}
import org.sonar.api.server.ws.RailsHandler;
import org.sonar.api.server.ws.WebService;
+import static org.sonar.api.server.ws.RailsHandler.addFormatParam;
+
public class PropertiesWs implements WebService {
@Override
}
private void defineIndexAction(NewController controller) {
- controller.createAction("index")
+ NewAction action = controller.createAction("index")
.setDescription("Documentation of this web service is available <a href=\"http://redirect.sonarsource.com/doc/old-web-service-api.html\">here</a>")
.setResponseExample(getClass().getResource("index-example.xml"))
.setSince("2.6")
.setHandler(RailsHandler.INSTANCE);
+ addFormatParam(action);
}
}
import org.sonar.api.server.ws.RailsHandler;
import org.sonar.api.server.ws.WebService;
+import static org.sonar.api.server.ws.RailsHandler.addFormatParam;
+
public class FavouritesWs implements WebService {
@Override
}
private void defineIndexAction(NewController controller) {
- controller.createAction("index")
+ NewAction action = controller.createAction("index")
.setDescription("Documentation of this web service is available <a href=\"http://redirect.sonarsource.com/doc/old-web-service-api.html\">here</a>")
.setResponseExample(getClass().getResource("favourites-index-example.xml"))
.setSince("2.6")
.setHandler(RailsHandler.INSTANCE);
+ addFormatParam(action);
}
}
*/
package org.sonar.server.user.ws;
-import org.sonar.api.server.ws.RailsHandler;
import org.sonar.api.server.ws.WebService;
+import static org.sonar.api.server.ws.RailsHandler.INSTANCE;
+import static org.sonar.api.server.ws.RailsHandler.addFormatParam;
+
public class UserPropertiesWs implements WebService {
@Override
}
private void defineIndexAction(NewController controller) {
- controller.createAction("index")
+ NewAction action = controller.createAction("index")
.setDescription("Documentation of this web service is available <a href=\"http://redirect.sonarsource.com/doc/old-web-service-api.html\">here</a>")
.setSince("2.6")
.setResponseExample(getClass().getResource("user_properties-index-example.xml"))
- .setHandler(RailsHandler.INSTANCE);
+ .setHandler(INSTANCE);
+ addFormatParam(action);
}
}
"<li>Accept:text/xml</li>" +
"<li>Accept:application/json</li>" +
"</ul></li></ul>" +
- "If nothing is set, json is used")
- .setPossibleValues("json", "xml");
+ "If nothing is set, json is used.<br/>" +
+ "Since 6.1, XML format is deprecated, only JSON format should be used.")
+ .setPossibleValues("json", "xml")
+ .setDeprecatedSince("6.1");
}
public static WebService.NewParam addJsonOnlyFormatParam(WebService.NewAction action) {