]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7205 WS api/users/search deprecate 'f' field
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 20 Jan 2016 15:13:40 +0000 (16:13 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 20 Jan 2016 15:13:40 +0000 (16:13 +0100)
server/sonar-server/src/main/java/org/sonar/server/user/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/user/ws/UserJsonWriter.java
sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java

index 270a336fe3fec6713f33eb1df4fcbeac89b57139..9f99a1d8d951d859f0b1f56527b2fb78c5a60053 100644 (file)
@@ -64,7 +64,8 @@ public class SearchAction implements UsersWsAction {
       .setHandler(this)
       .setResponseExample(getClass().getResource("search-example.json"));
 
-    action.addFieldsParam(UserJsonWriter.FIELDS);
+    action.createFieldsParam(UserJsonWriter.FIELDS)
+      .setDeprecatedSince("5.4");
     action.addPagingParams(50, MAX_LIMIT);
 
     action.createParam(Param.TEXT_QUERY)
index b4711a075fdb913299dd4f69a51ac3fdd94c9829..6958a6aebc16d7bf2128997d02411a66b2fbd485 100644 (file)
@@ -21,6 +21,7 @@ package org.sonar.server.user.ws;
 
 import com.google.common.collect.ImmutableSet;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Set;
 import javax.annotation.Nullable;
 import org.sonar.api.user.User;
@@ -80,7 +81,7 @@ public class UserJsonWriter {
     if (user == null) {
       json.beginObject().endObject();
     } else {
-      write(json, user, ImmutableSet.<String>of(), CONCISE_FIELDS);
+      write(json, user, Collections.<String>emptySet(), CONCISE_FIELDS);
     }
   }
 
index eb65e536154bddfcf32d12eb9cdd0dab9b951062..a82771df076acf15f42d590d893769507ee4ab10 100644 (file)
@@ -387,10 +387,14 @@ public interface WebService extends Definable<WebService.Context> {
      * used to restrict the number of fields returned in JSON response.
      */
     public NewAction addFieldsParam(Collection<?> possibleValues) {
-      createParam(Param.FIELDS)
+      createFieldsParam(possibleValues);
+      return this;
+    }
+
+    public NewParam createFieldsParam(Collection<?> possibleValues) {
+      return createParam(Param.FIELDS)
         .setDescription("Comma-separated list of the fields to be returned in response. All the fields are returned by default.")
         .setPossibleValues(possibleValues);
-      return this;
     }
 
     /**$