This is an automated email from the ASF dual-hosted git repository.

zhuzh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 2e4f9f53b0f [FLINK-39290][runtime] Fix doc generation caused by 
application exception naming
2e4f9f53b0f is described below

commit 2e4f9f53b0f9e6f1ca1f5dcf3cbd570269be4aa9
Author: Yi Zhang <[email protected]>
AuthorDate: Mon Mar 23 18:06:04 2026 +0800

    [FLINK-39290][runtime] Fix doc generation caused by application exception 
naming
---
 .../shortcodes/generated/rest_v1_dispatcher.html   | 74 ++++++++++++++++++++++
 docs/static/generated/rest_v1_dispatcher.yml       | 42 ++++++++++++
 .../src/test/resources/rest_api_v1.snapshot        |  2 +-
 .../ApplicationExceptionsInfoWithHistory.java      | 18 +++---
 .../ApplicationExceptionsHandlerTest.java          |  4 +-
 .../ApplicationExceptionsInfoWithHistoryTest.java  |  6 +-
 6 files changed, 131 insertions(+), 15 deletions(-)

diff --git a/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html 
b/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html
index 2c14469d782..f9c2073a702 100644
--- a/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html
+++ b/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html
@@ -221,6 +221,80 @@
     </tr>
   </tbody>
 </table>
+<table class="rest-api table table-bordered">
+  <tbody>
+    <tr>
+      <td class="text-left" 
colspan="2"><h5><strong>/applications/:applicationid/exceptions</strong></h5></td>
+    </tr>
+    <tr>
+      <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+      <td class="text-left">Response code: <code>200 OK</code></td>
+    </tr>
+    <tr>
+      <td colspan="2">Returns exception history for an application.</td>
+    </tr>
+    <tr>
+      <td colspan="2">Path parameters</td>
+    </tr>
+    <tr>
+      <td colspan="2">
+        <ul>
+<li><code>applicationid</code> - 32-character hexadecimal string value that 
identifies an application.</li>
+        </ul>
+      </td>
+    </tr>
+    <tr>
+      <td colspan="2">
+        <label>
+          <details>
+          <summary>Request</summary>
+          <pre><code>{}</code></pre>
+        </label>
+      </td>
+    </tr>
+    <tr>
+      <td colspan="2">
+        <label>
+          <details>
+          <summary>Response</summary>
+          <pre><code>{
+  "type" : "object",
+  "id" : 
"urn:jsonschema:org:apache:flink:runtime:rest:messages:ApplicationExceptionsInfoWithHistory",
+  "properties" : {
+    "exceptionHistory" : {
+      "type" : "object",
+      "id" : 
"urn:jsonschema:org:apache:flink:runtime:rest:messages:ApplicationExceptionsInfoWithHistory:ApplicationExceptionHistory",
+      "properties" : {
+        "entries" : {
+          "type" : "array",
+          "items" : {
+            "type" : "object",
+            "id" : 
"urn:jsonschema:org:apache:flink:runtime:rest:messages:ApplicationExceptionsInfoWithHistory:ApplicationExceptionInfo",
+            "properties" : {
+              "exceptionName" : {
+                "type" : "string"
+              },
+              "jobId" : {
+                "type" : "any"
+              },
+              "stacktrace" : {
+                "type" : "string"
+              },
+              "timestamp" : {
+                "type" : "integer"
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}</code></pre>
+        </label>
+      </td>
+    </tr>
+  </tbody>
+</table>
 <table class="rest-api table table-bordered">
   <tbody>
     <tr>
diff --git a/docs/static/generated/rest_v1_dispatcher.yml 
b/docs/static/generated/rest_v1_dispatcher.yml
index e76c44fc536..2467aa7e8ad 100644
--- a/docs/static/generated/rest_v1_dispatcher.yml
+++ b/docs/static/generated/rest_v1_dispatcher.yml
@@ -51,6 +51,24 @@ paths:
       responses:
         "202":
           description: The request was successful.
+  /applications/{applicationid}/exceptions:
+    get:
+      description: Returns exception history for an application.
+      operationId: getApplicationExceptions
+      parameters:
+      - name: applicationid
+        in: path
+        description: 32-character hexadecimal string value that identifies an 
application.
+        required: true
+        schema:
+          $ref: "#/components/schemas/ApplicationID"
+      responses:
+        "200":
+          description: The request was successful.
+          content:
+            application/json:
+              schema:
+                $ref: 
"#/components/schemas/ApplicationExceptionsInfoWithHistory"
   /applications/{applicationid}/jobmanager/config:
     get:
       description: Returns the jobmanager's configuration of a specific 
application.
@@ -1842,6 +1860,30 @@ components:
           additionalProperties:
             type: integer
             format: int64
+    ApplicationExceptionHistory:
+      type: object
+      properties:
+        entries:
+          type: array
+          items:
+            $ref: "#/components/schemas/ApplicationExceptionInfo"
+    ApplicationExceptionInfo:
+      type: object
+      properties:
+        exceptionName:
+          type: string
+        jobId:
+          $ref: "#/components/schemas/JobID"
+        stacktrace:
+          type: string
+        timestamp:
+          type: integer
+          format: int64
+    ApplicationExceptionsInfoWithHistory:
+      type: object
+      properties:
+        exceptionHistory:
+          $ref: "#/components/schemas/ApplicationExceptionHistory"
     ApplicationID:
       type: object
       properties:
diff --git a/flink-runtime-web/src/test/resources/rest_api_v1.snapshot 
b/flink-runtime-web/src/test/resources/rest_api_v1.snapshot
index 38cafeea1b9..e065545a069 100644
--- a/flink-runtime-web/src/test/resources/rest_api_v1.snapshot
+++ b/flink-runtime-web/src/test/resources/rest_api_v1.snapshot
@@ -230,7 +230,7 @@
               "type" : "array",
               "items" : {
                 "type" : "object",
-                "id" : 
"urn:jsonschema:org:apache:flink:runtime:rest:messages:ApplicationExceptionsInfoWithHistory:ExceptionInfo",
+                "id" : 
"urn:jsonschema:org:apache:flink:runtime:rest:messages:ApplicationExceptionsInfoWithHistory:ApplicationExceptionInfo",
                 "properties" : {
                   "exceptionName" : {
                     "type" : "string"
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ApplicationExceptionsInfoWithHistory.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ApplicationExceptionsInfoWithHistory.java
index 15be60cf38c..aa4d36425d8 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ApplicationExceptionsInfoWithHistory.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ApplicationExceptionsInfoWithHistory.java
@@ -97,7 +97,7 @@ public class ApplicationExceptionsInfoWithHistory implements 
ResponseBody {
                         exceptions.stream()
                                 .map(
                                         exception ->
-                                                new ExceptionInfo(
+                                                new ApplicationExceptionInfo(
                                                         exception
                                                                 .getException()
                                                                 
.getOriginalErrorClassName(),
@@ -112,16 +112,16 @@ public class ApplicationExceptionsInfoWithHistory 
implements ResponseBody {
         public static final String FIELD_NAME_ENTRIES = "entries";
 
         @JsonProperty(FIELD_NAME_ENTRIES)
-        private final List<ExceptionInfo> entries;
+        private final List<ApplicationExceptionInfo> entries;
 
         @JsonCreator
         public ApplicationExceptionHistory(
-                @JsonProperty(FIELD_NAME_ENTRIES) List<ExceptionInfo> entries) 
{
+                @JsonProperty(FIELD_NAME_ENTRIES) 
List<ApplicationExceptionInfo> entries) {
             this.entries = entries;
         }
 
         @JsonIgnore
-        public List<ExceptionInfo> getEntries() {
+        public List<ApplicationExceptionInfo> getEntries() {
             return entries;
         }
 
@@ -151,7 +151,7 @@ public class ApplicationExceptionsInfoWithHistory 
implements ResponseBody {
         }
     }
 
-    public static class ExceptionInfo {
+    public static class ApplicationExceptionInfo {
 
         public static final String FIELD_NAME_EXCEPTION_NAME = "exceptionName";
         public static final String FIELD_NAME_EXCEPTION_STACKTRACE = 
"stacktrace";
@@ -173,12 +173,12 @@ public class ApplicationExceptionsInfoWithHistory 
implements ResponseBody {
         @Nullable
         private final JobID jobId;
 
-        public ExceptionInfo(String exceptionName, String stacktrace, long 
timestamp) {
+        public ApplicationExceptionInfo(String exceptionName, String 
stacktrace, long timestamp) {
             this(exceptionName, stacktrace, timestamp, null);
         }
 
         @JsonCreator
-        public ExceptionInfo(
+        public ApplicationExceptionInfo(
                 @JsonProperty(FIELD_NAME_EXCEPTION_NAME) String exceptionName,
                 @JsonProperty(FIELD_NAME_EXCEPTION_STACKTRACE) String 
stacktrace,
                 @JsonProperty(FIELD_NAME_EXCEPTION_TIMESTAMP) long timestamp,
@@ -221,7 +221,7 @@ public class ApplicationExceptionsInfoWithHistory 
implements ResponseBody {
             if (o == null || getClass() != o.getClass()) {
                 return false;
             }
-            ExceptionInfo that = (ExceptionInfo) o;
+            ApplicationExceptionInfo that = (ApplicationExceptionInfo) o;
             return exceptionName.equals(that.exceptionName)
                     && stacktrace.equals(that.stacktrace)
                     && Objects.equals(timestamp, that.timestamp)
@@ -235,7 +235,7 @@ public class ApplicationExceptionsInfoWithHistory 
implements ResponseBody {
 
         @Override
         public String toString() {
-            return new StringJoiner(", ", ExceptionInfo.class.getSimpleName() 
+ "[", "]")
+            return new StringJoiner(", ", 
ApplicationExceptionInfo.class.getSimpleName() + "[", "]")
                     .add("exceptionName='" + exceptionName + "'")
                     .add("stacktrace='" + stacktrace + "'")
                     .add("timestamp=" + timestamp)
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/application/ApplicationExceptionsHandlerTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/application/ApplicationExceptionsHandlerTest.java
index 27b0e42eab9..26c11a60409 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/application/ApplicationExceptionsHandlerTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/application/ApplicationExceptionsHandlerTest.java
@@ -135,7 +135,7 @@ class ApplicationExceptionsHandlerTest {
                 handler.handleRequest(handlerRequest, 
testingRestfulGateway).get();
 
         assertThat(response.getExceptionHistory().getEntries()).hasSize(1);
-        final ApplicationExceptionsInfoWithHistory.ExceptionInfo exceptionInfo 
=
+        final ApplicationExceptionsInfoWithHistory.ApplicationExceptionInfo 
exceptionInfo =
                 response.getExceptionHistory().getEntries().get(0);
         
assertThat(exceptionInfo.getExceptionName()).isEqualTo(rootCause.getClass().getName());
         assertThat(exceptionInfo.getTimestamp()).isEqualTo(rootCauseTimestamp);
@@ -172,7 +172,7 @@ class ApplicationExceptionsHandlerTest {
                 handler.handleRequest(handlerRequest, 
testingRestfulGateway).get();
 
         assertThat(response.getExceptionHistory().getEntries()).hasSize(1);
-        final ApplicationExceptionsInfoWithHistory.ExceptionInfo exceptionInfo 
=
+        final ApplicationExceptionsInfoWithHistory.ApplicationExceptionInfo 
exceptionInfo =
                 response.getExceptionHistory().getEntries().get(0);
         
assertThat(exceptionInfo.getExceptionName()).isEqualTo(rootCause.getClass().getName());
         assertThat(exceptionInfo.getTimestamp()).isEqualTo(rootCauseTimestamp);
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/ApplicationExceptionsInfoWithHistoryTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/ApplicationExceptionsInfoWithHistoryTest.java
index 7073d7d5822..4a6cdc98021 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/ApplicationExceptionsInfoWithHistoryTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/ApplicationExceptionsInfoWithHistoryTest.java
@@ -49,9 +49,9 @@ class ApplicationExceptionsInfoWithHistoryTest
         return new ApplicationExceptionsInfoWithHistory(
                 new 
ApplicationExceptionsInfoWithHistory.ApplicationExceptionHistory(
                         Arrays.asList(
-                                new 
ApplicationExceptionsInfoWithHistory.ExceptionInfo(
+                                new 
ApplicationExceptionsInfoWithHistory.ApplicationExceptionInfo(
                                         "exception #0", "stacktrace #0", 0L, 
new JobID()),
-                                new 
ApplicationExceptionsInfoWithHistory.ExceptionInfo(
+                                new 
ApplicationExceptionsInfoWithHistory.ApplicationExceptionInfo(
                                         "exception #1", "stacktrace #1", 1L, 
null))));
     }
 
@@ -65,7 +65,7 @@ class ApplicationExceptionsInfoWithHistoryTest
         ObjectMapper objMapper = RestMapperUtils.getStrictObjectMapper();
         String json =
                 objMapper.writeValueAsString(
-                        new ApplicationExceptionsInfoWithHistory.ExceptionInfo(
+                        new 
ApplicationExceptionsInfoWithHistory.ApplicationExceptionInfo(
                                 "exception name", "stacktrace", 0L));
 
         assertThat(json).doesNotContain("jobId");

Reply via email to