diff --git a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/consumergroup/OffsetDetails.java b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/consumergroup/OffsetDetails.java index 2ffb4553c8..0827e855f5 100644 --- a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/consumergroup/OffsetDetails.java +++ b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/consumergroup/OffsetDetails.java @@ -1,14 +1,15 @@ package io.aiven.klaw.clusterapi.models.consumergroup; +import jakarta.validation.constraints.NotNull; import lombok.Data; @Data public class OffsetDetails { - private String topicPartitionId; + @NotNull private String topicPartitionId; - private String currentOffset; + @NotNull private String currentOffset; - private String endOffset; + @NotNull private String endOffset; - private String lag; + @NotNull private String lag; } diff --git a/coral/package.json b/coral/package.json index f9304d8156..f33e31f5a9 100644 --- a/coral/package.json +++ b/coral/package.json @@ -36,9 +36,6 @@ ], "**/*.{md, css}": [ "prettier --check" - ], - "../openapi.yaml": [ - "prettier --check" ] }, "dependencies": { diff --git a/coral/src/app/features/topics/details/subscriptions/components/ConsumerOffsetsValues.tsx b/coral/src/app/features/topics/details/subscriptions/components/ConsumerOffsetsValues.tsx index 02b1ae03d6..463154ecbe 100644 --- a/coral/src/app/features/topics/details/subscriptions/components/ConsumerOffsetsValues.tsx +++ b/coral/src/app/features/topics/details/subscriptions/components/ConsumerOffsetsValues.tsx @@ -15,10 +15,10 @@ interface ConsumerOffsetsProps { } const parseOffsetsContent = ({ - topicPartitionId = "Unknown", - currentOffset = "Unknown", - endOffset = "Unknown", - lag = "Unknown", + topicPartitionId, + currentOffset, + endOffset, + lag, }: ConsumerOffsets) => { return `Partition ${topicPartitionId}: Current offset ${currentOffset} | End offset ${endOffset} | Lag ${lag}`; }; @@ -88,7 +88,7 @@ const ConsumerOffsetsValues = ({ offsetsData.map((data, index) => { return ( {parseOffsetsContent(data)} diff --git a/coral/types/api.d.ts b/coral/types/api.d.ts index 5f0435d30e..50e5ccc641 100644 --- a/coral/types/api.d.ts +++ b/coral/types/api.d.ts @@ -1540,10 +1540,10 @@ export type components = { teamMembersCount?: number; }; OffsetDetails: { - topicPartitionId?: string; - currentOffset?: string; - endOffset?: string; - lag?: string; + topicPartitionId: string; + currentOffset: string; + endOffset: string; + lag: string; }; KafkaConnectorRequestsResponseModel: { environment: string; diff --git a/core/src/main/java/io/aiven/klaw/model/cluster/consumergroup/OffsetDetails.java b/core/src/main/java/io/aiven/klaw/model/cluster/consumergroup/OffsetDetails.java index 2dc8facf39..26b3944060 100644 --- a/core/src/main/java/io/aiven/klaw/model/cluster/consumergroup/OffsetDetails.java +++ b/core/src/main/java/io/aiven/klaw/model/cluster/consumergroup/OffsetDetails.java @@ -1,14 +1,15 @@ package io.aiven.klaw.model.cluster.consumergroup; +import jakarta.validation.constraints.NotNull; import lombok.Data; @Data public class OffsetDetails { - private String topicPartitionId; + @NotNull private String topicPartitionId; - private String currentOffset; + @NotNull private String currentOffset; - private String endOffset; + @NotNull private String endOffset; - private String lag; + @NotNull private String lag; } diff --git a/core/src/main/java/io/aiven/klaw/model/response/OffsetDetails.java b/core/src/main/java/io/aiven/klaw/model/response/OffsetDetails.java index 67a8af9e77..957b1ddc69 100644 --- a/core/src/main/java/io/aiven/klaw/model/response/OffsetDetails.java +++ b/core/src/main/java/io/aiven/klaw/model/response/OffsetDetails.java @@ -1,14 +1,15 @@ package io.aiven.klaw.model.response; +import jakarta.validation.constraints.NotNull; import lombok.Data; @Data public class OffsetDetails { - private String topicPartitionId; + @NotNull private String topicPartitionId; - private String currentOffset; + @NotNull private String currentOffset; - private String endOffset; + @NotNull private String endOffset; - private String lag; + @NotNull private String lag; } diff --git a/openapi.yaml b/openapi.yaml index 8995e2bd3b..c3afc1309c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -8777,7 +8777,8 @@ "lag" : { "type" : "string" } - } + }, + "required" : [ "currentOffset", "endOffset", "lag", "topicPartitionId" ] }, "KafkaConnectorRequestsResponseModel" : { "properties" : {