]> source.dussan.org Git - sonarqube.git/commitdiff
NO-JIRA adding missing response example in the internal endpoint
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>
Thu, 2 Jun 2022 14:06:30 +0000 (16:06 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 2 Jun 2022 20:03:18 +0000 (20:03 +0000)
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/PullAction.java
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/issue/ws/pull-example.proto [new file with mode: 0644]

index 269689afc4baa8f5880542539ae8763e216b9020..660f74d6d4c7b99265d9f6f5133fbfd287d872e6 100644 (file)
@@ -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 (file)
index 0000000..62358e1
--- /dev/null
@@ -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