Skip to content

Commit a7a59d8

Browse files
committed
Fixes in contracts for backward compatibility
1 parent 6ce97f8 commit a7a59d8

File tree

12 files changed

+222
-219
lines changed

12 files changed

+222
-219
lines changed

contract-typespec/api/acls.tsp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,17 @@ enum KafkaAclNamePatternType {
114114
}
115115

116116
model CreateConsumerAcl {
117-
principal: string;
118-
host: string;
117+
principal?: string;
118+
host?: string;
119119
topics?: string[];
120120
topicsPrefix?: string;
121121
consumerGroups?: string[];
122122
consumerGroupsPrefix?: string;
123123
}
124124

125125
model CreateProducerAcl {
126-
principal: string;
127-
host: string;
126+
principal?: string;
127+
host?: string;
128128
topics?: string[];
129129
topicsPrefix?: string;
130130
transactionalId?: string;
@@ -133,9 +133,9 @@ model CreateProducerAcl {
133133
}
134134

135135
model CreateStreamAppAcl {
136-
principal: string;
137-
host: string;
138-
inputTopics: string[];
139-
outputTopics: string[];
140-
applicationId: string;
136+
principal?: string;
137+
host?: string;
138+
inputTopics?: string[];
139+
outputTopics?: string[];
140+
applicationId?: string;
141141
}

contract-typespec/api/auth.tsp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ interface AuthorizationApi {
1818
@doc("Authenticate")
1919
@operationId("authenticate")
2020
@post
21-
op authenticate(@body form: LoginForm): void | Http.Response<401>;
21+
@tag("Unmapped")
22+
op authenticate(@header contentType: "application/x-www-form-urlencoded", @body form: LoginForm): void | Http.Response<401>;
23+
2224

2325
model LoginForm {
24-
username: string;
25-
password: string;
26+
username?: string;
27+
password?: string;
2628
}
2729

2830
model AuthenticationInfo {

contract-typespec/api/brokers.tsp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,36 @@ model BrokerConfigItem {
8888
value?: string;
8989
}
9090

91+
model BrokerLogdirs {
92+
name?: string;
93+
error?: string;
94+
topics?: TopicLogdirs[];
95+
}
96+
97+
model TopicLogdirs {
98+
name?: string;
99+
partitions?: TopicPartitionLogdir[];
100+
}
101+
91102
model BrokerMetrics {
92-
segmentSize: int64;
93-
segmentCount: int32;
94-
metrics: Metric[];
103+
segmentSize?: int64;
104+
segmentCount?: int32;
105+
metrics?: Metric[];
95106
}
96107

97108
model BrokersLogdirs {
98-
name: string;
99-
error: string;
100-
topics: BrokerTopicLogdirs[];
109+
name?: string;
110+
error?: string;
111+
topics?: BrokerTopicLogdirs[];
101112
}
102113

103114
model BrokerTopicLogdirs {
104115
name?: string;
105116
partitions?: BrokerTopicPartitionLogdir[];
106117
}
107118

108-
model BrokerTopicPartitionLogdir extends TopicPartitionLogdir {
119+
model BrokerTopicPartitionLogdir {
120+
...TopicPartitionLogdir;
109121
broker?: int32;
110122
}
111123

contract-typespec/api/clusters.tsp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ interface ClustersApi {
3535

3636
model Cluster {
3737
name: string;
38-
defaultCluster: boolean;
38+
defaultCluster?: boolean;
3939
status: ServerStatus;
4040
lastError?: MetricsCollectionError;
41-
brokerCount: int32;
42-
onlinePartitionCount: int32;
43-
topicCount: int32;
41+
brokerCount?: int32;
42+
onlinePartitionCount?: int32;
43+
topicCount?: int32;
4444
bytesInPerSec?: float64;
4545
bytesOutPerSec?: float64;
46-
readOnly: boolean;
47-
version: string;
48-
features: ClusterFeature[];
46+
readOnly?: boolean;
47+
version?: string;
48+
features?: ClusterFeature[];
4949
}
5050

5151
alias ClusterFeature =
@@ -68,20 +68,20 @@ model ClusterMetrics {
6868
}
6969

7070
model ClusterStats {
71-
brokerCount: int32;
71+
brokerCount?: int32;
7272
#deprecated "Unused"
7373
zooKeeperStatus?: int32;
7474

7575
@doc("Id of broker which is cluster's controller. null, if controller not known yet.")
76-
activeControllers: int32;
77-
78-
onlinePartitionCount: int32;
79-
offlinePartitionCount: int32;
80-
inSyncReplicasCount: int32;
81-
outOfSyncReplicasCount: int32;
82-
underReplicatedPartitionCount: int32;
83-
diskUsage: BrokerDiskUsage[];
84-
version: string;
76+
activeControllers?: int32;
77+
78+
onlinePartitionCount?: int32;
79+
offlinePartitionCount?: int32;
80+
inSyncReplicasCount?: int32;
81+
outOfSyncReplicasCount?: int32;
82+
underReplicatedPartitionCount?: int32;
83+
diskUsage?: BrokerDiskUsage[];
84+
version?: string;
8585
}
8686

8787
model MetricsCollectionError {
@@ -92,6 +92,6 @@ model MetricsCollectionError {
9292

9393
model BrokerDiskUsage {
9494
brokerId: int32;
95-
segmentSize: int64;
96-
segmentCount: int32;
95+
segmentSize?: int64;
96+
segmentCount?: int32;
9797
}

0 commit comments

Comments
 (0)