]> source.dussan.org Git - sonarqube.git/commitdiff
Add some doc + fix /api/profiles/list when no language is provided
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 11 Oct 2012 16:20:51 +0000 (18:20 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 11 Oct 2012 16:21:05 +0000 (18:21 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/authentication_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb

index 5554c8f472865a7a05c0b261f7d515b16b9cbf49..f2eb6f88b71fc3371381f64cdfe67e4b71f9aae8 100644 (file)
@@ -27,6 +27,7 @@ class Api::AuthenticationController < Api::ApiController
   # GET /api/authentication/validate
   # curl http://localhost:9000/api/authentication/validate -v -u admin:admin
   #
+  # Since v.3.3
   def validate
     hash={:valid => valid?}
 
index 906a24457687e8a15627904d4fc88c1292b9835a..659ecfb0f719646a9c41a957aab6c93d95b05aea 100644 (file)
@@ -23,6 +23,8 @@ class Api::ProfilesController < Api::ApiController
 
   # GET /api/profiles/list?[language=<language][&project=<project id or key>]
   #
+  # Since v.3.3
+  #
   # ==== Examples
   # - get all the profiles : GET /api/profiles/list
   # - get all the Java profiles : GET /api/profiles/list?language=java
@@ -38,7 +40,7 @@ class Api::ProfilesController < Api::ApiController
       if language.present?
         profiles=[Profile.by_project_id(language, project.id, true)]
       else
-        profiles=Api::Utils.languages.map { |lang| Profile.by_project_id(lang, project.id, true) }
+        profiles=Api::Utils.languages.map { |lang| Profile.by_project_id(lang.getKey(), project.id, true) }
       end
     elsif language.present?
       profiles=Profile.all_by_language(language)
@@ -69,6 +71,8 @@ class Api::ProfilesController < Api::ApiController
   end
 
   # POST /api/profiles/set_as_default?language=<language>&name=<name>
+  #
+  # Since v.3.3
   def set_as_default
     verify_post_request
     access_denied unless has_role?(:admin)