Skip to content

Commit

Permalink
fix(core/coral): Make OffsetDetails properties required, remove prett…
Browse files Browse the repository at this point in the history
…ier check on openapi.yaml

Signed-off-by: Mathieu Anderson <[email protected]>
  • Loading branch information
Mathieu Anderson committed Nov 23, 2023
1 parent 0981b8b commit 3dc63fa
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}
3 changes: 0 additions & 3 deletions coral/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
],
"**/*.{md, css}": [
"prettier --check"
],
"../openapi.yaml": [
"prettier --check"
]
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
};
Expand Down Expand Up @@ -88,7 +88,7 @@ const ConsumerOffsetsValues = ({
offsetsData.map((data, index) => {
return (
<Typography.Default
key={data?.topicPartitionId || index}
key={data.topicPartitionId || index}
htmlTag="dd"
>
{parseOffsetsContent(data)}
Expand Down
8 changes: 4 additions & 4 deletions coral/types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
3 changes: 2 additions & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8777,7 +8777,8 @@
"lag" : {
"type" : "string"
}
}
},
"required" : [ "currentOffset", "endOffset", "lag", "topicPartitionId" ]
},
"KafkaConnectorRequestsResponseModel" : {
"properties" : {
Expand Down

0 comments on commit 3dc63fa

Please sign in to comment.