[SonarQube 7.1] Small documentation bug in web API qualityprofiles/delete: doc for 'key' parameter missing

web_api
sonarqube

(Volker Stolz) #1

For SQ 7.1 the web API docs at http://localhost:9000/web_api/api/qualityprofiles for operation “delete” show only the optional parameters “language” and “qualityProfile”. The alternative “key” is missing from the documentation, but works as expected.

(Tested with the sonarqube:latest Docker-image)


(G Ann Campbell) #2

Hi,

Thanks for the report.

https://jira.sonarsource.com/browse/SONAR-11126

Ann


(Julien Lancelot) #3

The key parameter is documented : it’s deprecated since SonarQube 6.6 :

As a consequence, I’ll delete the ticket you’ve created @ganncamp.


(Volker Stolz) #4

Oh, I see – there’s a separate checkbox somewhere in the UI that one has to tick to see the deprecated APIs.

Nonetheless, then there’s still something wrong with the API docs: qualityprofiles/delete only documents two optional arguments, which do not seem so optional after all:

# create a new profile by copying
$ curl -u admin:admin -d fromKey=AWUi4vmmbmJsQitOewAp -d toName=test http://localhost:9000/api/qualityprofiles/copy
{"key":"AWUi5hjTbmJsQitOeweY","name":"test","language":"cs","languageName":"C#","isDefault":false,"isInherited":false}
# try to delete new profile by name
$ curl -u admin:admin -d qualityProfile=test http://localhost:9000/api/qualityprofiles/delete
{"errors":[{"msg":"If no quality profile key is specified, language and name must be set"}]}
# delete new profile with name & language
$ curl -u admin:admin -d language=cs -d qualityProfile=test http://localhost:9000/api/qualityprofiles/delete
# success!

(Julien Lancelot) #5

Hi @VolkerStolz,

You’re right, thanks for providing this feedback.
I’ve created https://jira.sonarsource.com/browse/SONAR-11154 to do some cleanup in the quality profiles web services.

Regards