aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>2022-06-02 16:06:30 +0200
committersonartech <sonartech@sonarsource.com>2022-06-02 20:03:18 +0000
commit877e5bb72c09153a7866cbec449f49542266a9a5 (patch)
tree84af227ec995c1ebbfe62da3a89f40f115e1d31f
parentc1ffad259a8bc6287a963748a4e6663009ea55b7 (diff)
downloadsonarqube-877e5bb72c09153a7866cbec449f49542266a9a5.tar.gz
sonarqube-877e5bb72c09153a7866cbec449f49542266a9a5.zip
NO-JIRA adding missing response example in the internal endpoint
-rw-r--r--server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/PullAction.java1
-rw-r--r--server/sonar-webserver-webapi/src/main/resources/org/sonar/server/issue/ws/pull-example.proto29
2 files changed, 30 insertions, 0 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/PullAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/PullAction.java
index 269689afc4b..660f74d6d4c 100644
--- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/PullAction.java
+++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/PullAction.java
@@ -65,6 +65,7 @@ public class PullAction implements IssuesWsAction {
.createAction(ACTION_PULL)
.setHandler(this)
.setInternal(true)
+ .setResponseExample(getClass().getResource("pull-example.proto"))
.setDescription("This endpoint fetches and returns all (unless filtered by optional params) the issues for a given branch." +
"The issues returned are not paginated, so the response size can be big.")
.setSince("9.5");
diff --git a/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/issue/ws/pull-example.proto b/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/issue/ws/pull-example.proto
new file mode 100644
index 00000000000..62358e1afb5
--- /dev/null
+++ b/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/issue/ws/pull-example.proto
@@ -0,0 +1,29 @@
+# The response contains a single protocol buffer message: IssuesPullQueryTimestamp followed by 0..n number of IssueLite protocol buffer messages.
+message IssuesPullQueryTimestamp {
+ required int64 queryTimestamp = 1;
+}
+
+message IssueLite {
+ required string key = 1;
+ optional int64 creationDate = 2;
+ optional bool resolved = 3;
+ optional string ruleKey = 4;
+ optional string userSeverity = 5;
+ optional string type = 6;
+ optional Location mainLocation = 7;
+ optional bool closed = 8;
+}
+
+message Location {
+ optional string filePath = 1;
+ optional string message = 2;
+ optional TextRange textRange = 3;
+}
+
+message TextRange {
+ optional int32 startLine = 1;
+ optional int32 startLineOffset = 2;
+ optional int32 endLine = 3;
+ optional int32 endLineOffset = 4;
+ optional string hash = 5;
+} \ No newline at end of file