Browse Source

SONAR-14907 Update WebAPI examples

tags/9.2.0.49834
Wouter Admiraal 2 years ago
parent
commit
ca82e028bc

+ 1
- 1
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SearchAction.java View File

@@ -245,7 +245,7 @@ public class SearchAction implements IssuesWsAction {
.setBooleanPossibleValues();
action.createParam(PARAM_RULES)
.setDescription("Comma-separated list of coding rule keys. Format is <repository>:<rule>")
.setExampleValue("squid:AvoidCycles");
.setExampleValue("java:S1144");
action.createParam(PARAM_TAGS)
.setDescription("Comma-separated list of tags.")
.setExampleValue("security,convention");

+ 1
- 1
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/DeactivateRuleAction.java View File

@@ -71,7 +71,7 @@ public class DeactivateRuleAction implements QProfileWsAction {
deactivate.createParam(PARAM_RULE)
.setDescription("Rule key")
.setRequired(true)
.setExampleValue("squid:AvoidCycles");
.setExampleValue("java:S1144");
}

@Override

+ 1
- 1
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/DeleteAction.java View File

@@ -65,7 +65,7 @@ public class DeleteAction implements RulesWsAction {
.createParam(PARAM_KEY)
.setDescription("Rule key")
.setRequired(true)
.setExampleValue("squid:XPath_1402065390816");
.setExampleValue("java:S1144");
}

@Override

+ 1
- 1
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RepositoriesAction.java View File

@@ -60,7 +60,7 @@ public class RepositoriesAction implements RulesWsAction {

action.createParam(Param.TEXT_QUERY)
.setDescription("A pattern to match repository keys/names against")
.setExampleValue("squid");
.setExampleValue("java");
action.createParam(LANGUAGE)
.setDescription("A language key; if provided, only repositories for the given language will be returned")
.setExampleValue("java");

+ 2
- 2
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RuleWsSupport.java View File

@@ -101,12 +101,12 @@ public class RuleWsSupport {
action
.createParam(PARAM_RULE_KEY)
.setDescription("Key of rule to search for")
.setExampleValue("squid:S001");
.setExampleValue("java:S1144");

action
.createParam(PARAM_REPOSITORIES)
.setDescription("Comma-separated list of repositories")
.setExampleValue("checkstyle,findbugs");
.setExampleValue("java,html");

action
.createParam(PARAM_SEVERITIES)

+ 1
- 1
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/rule/ws/repositories-example.json View File

@@ -21,7 +21,7 @@
{"key": "javascript", "name": "SonarQube", "language": "js"},
{"key": "objc", "name": "SonarQube", "language": "objc"},
{"key": "php", "name": "SonarQube", "language": "php"},
{"key": "squid", "name": "SonarQube", "language": "java"},
{"key": "java", "name": "SonarQube", "language": "java"},
{"key": "stylecop", "name": "StyleCop", "language": "cs"}
]
}

+ 1
- 1
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/user/ws/search-example.json View File

@@ -35,7 +35,7 @@
"tokensCount": 3,
"local": false,
"externalIdentity": "sbrandhof@ldap.com",
"externalProvider": "LDAP",
"externalProvider": "sonarqube",
"avatar": "3930ad855bc7fe48db8e9a663174cdd3"
}
]

+ 1
- 1
server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/SearchActionTest.java View File

@@ -353,7 +353,7 @@ public class SearchActionTest {
UserDto simon = db.users().insertUser(u -> u.setLogin("sbrandhof").setName("Simon").setEmail("s.brandhof@company.tld")
.setLocal(false)
.setExternalLogin("sbrandhof@ldap.com")
.setExternalIdentityProvider("LDAP")
.setExternalIdentityProvider("sonarqube")
.setScmAccounts(asList("simon.brandhof", "s.brandhof@company.tld")));
GroupDto sonarUsers = db.users().insertGroup("sonar-users");
GroupDto sonarAdministrators = db.users().insertGroup("sonar-administrators");

+ 3
- 3
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/RuleSearchWsHandlerTest/search_rules.json View File

@@ -1,9 +1,9 @@
{"more": false, "total": 1,
"results": [
{
"key": "squid:AvoidCycle",
"repository": "squid",
"name": "Avoid cycle",
"key": "java:S1144",
"repository": "java",
"name": "Unused \"private\" methods should be removed",
"language": "Java",
"status": "READY",
"debtCharacteristic": "REUSABILITY",

Loading…
Cancel
Save