Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7737

qualityprofiles/restore_built_in should throw an error if language does not exist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6
    • Fix Version/s: 6.1
    • Component/s: Quality Profile, Web API
    • Labels:

      Description

      When issuing a POST on api/qualityprofiles/restore_built_in with a language which does not exist, the response still is 204 with no error whatsoever. This can be confusing when mixing up the language name with language key i.e. Java instead of java.

      Current behaviour:

      $ curl -I  -u admin:admin -X POST "http://192.168.56.10:9056/api/qualityprofiles/restore_built_in?language=Java"
      HTTP/1.1 204 No Content
      Server: Apache-Coyote/1.1
      Set-Cookie: JSESSIONID=FCF61B715D6AB07913AF98971EA7F637; Path=/; HttpOnly
      Cache-Control: no-cache
      X-Runtime: 1224
      X-Frame-Options: SAMEORIGIN
      X-XSS-Protection: 1; mode=block
      X-Content-Type-Options: nosniff
      X-Frame-Options: SAMEORIGIN
      X-XSS-Protection: 1; mode=block
      X-Content-Type-Options: nosniff
      

      Desired behaviour:

      • error code (+message eventually) returned

      Note:

      • API documentation could clarify that the language key is expected

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              julien.lancelot Julien Lancelot
              Reporter:
              nicolas.bontoux Nicolas Bontoux
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: