This is an automated email from the ASF dual-hosted git repository. chesnay pushed a commit to branch release-1.18 in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.18 by this push: new ef950f86af3 [FLINK-33352][rest][docs] Add schema mappings to discriminator properties ef950f86af3 is described below commit ef950f86af3f9a3cccca585529dad788c466e437 Author: Chesnay Schepler <ches...@apache.org> AuthorDate: Tue Oct 24 16:36:10 2023 +0200 [FLINK-33352][rest][docs] Add schema mappings to discriminator properties --- docs/static/generated/rest_v1_dispatcher.yml | 7 +++++++ .../rest/messages/checkpoints/CheckpointStatistics.java | 16 ++++++++++++++++ .../checkpoints/SubtaskCheckpointStatistics.java | 14 ++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/docs/static/generated/rest_v1_dispatcher.yml b/docs/static/generated/rest_v1_dispatcher.yml index 4c510e93742..bf0c9056bf9 100644 --- a/docs/static/generated/rest_v1_dispatcher.yml +++ b/docs/static/generated/rest_v1_dispatcher.yml @@ -1819,6 +1819,10 @@ components: format: int64 discriminator: propertyName: className + mapping: + completed: '#/components/schemas/CompletedCheckpointStatistics' + failed: '#/components/schemas/FailedCheckpointStatistics' + in_progress: '#/components/schemas/PendingCheckpointStatistics' CheckpointStatisticsSummary: type: object properties: @@ -2935,6 +2939,9 @@ components: type: string discriminator: propertyName: className + mapping: + completed: '#/components/schemas/CompletedSubtaskCheckpointStatistics' + pending: '#/components/schemas/PendingSubtaskCheckpointStatistics' SubtaskExecutionAttemptAccumulatorsInfo: type: object properties: diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointStatistics.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointStatistics.java index fd8ed6f087b..b38f57c9878 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointStatistics.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointStatistics.java @@ -41,6 +41,9 @@ import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonTyp import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.v3.oas.annotations.media.DiscriminatorMapping; +import io.swagger.v3.oas.annotations.media.Schema; + import javax.annotation.Nullable; import java.util.Collection; @@ -64,6 +67,19 @@ import java.util.Objects; value = CheckpointStatistics.PendingCheckpointStatistics.class, name = "in_progress") }) +@Schema( + discriminatorProperty = "className", + discriminatorMapping = { + @DiscriminatorMapping( + value = "completed", + schema = CheckpointStatistics.CompletedCheckpointStatistics.class), + @DiscriminatorMapping( + value = "failed", + schema = CheckpointStatistics.FailedCheckpointStatistics.class), + @DiscriminatorMapping( + value = "in_progress", + schema = CheckpointStatistics.PendingCheckpointStatistics.class), + }) public class CheckpointStatistics implements ResponseBody { public static final String FIELD_NAME_ID = "id"; diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/SubtaskCheckpointStatistics.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/SubtaskCheckpointStatistics.java index 642509a965c..613916eb3d7 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/SubtaskCheckpointStatistics.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/SubtaskCheckpointStatistics.java @@ -23,6 +23,9 @@ import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonPro import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonSubTypes; import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.DiscriminatorMapping; +import io.swagger.v3.oas.annotations.media.Schema; + import java.util.Objects; /** Checkpoint statistics for a subtask. */ @@ -38,6 +41,17 @@ import java.util.Objects; value = SubtaskCheckpointStatistics.PendingSubtaskCheckpointStatistics.class, name = "pending") }) +@Schema( + discriminatorProperty = "className", + discriminatorMapping = { + @DiscriminatorMapping( + value = "completed", + schema = + SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics.class), + @DiscriminatorMapping( + value = "pending", + schema = SubtaskCheckpointStatistics.PendingSubtaskCheckpointStatistics.class), + }) public class SubtaskCheckpointStatistics { public static final String FIELD_NAME_INDEX = "index";