Skip to content

Commit bcae096

Browse files
committed
Enabled contract validation
1 parent fa8b03b commit bcae096

File tree

13 files changed

+311
-150
lines changed

13 files changed

+311
-150
lines changed

contract-typespec/api/acls.tsp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ using OpenAPI;
88
@route("/api/clusters/{clusterName}/acls")
99
@tag("Acls")
1010
interface AclApi {
11-
@doc("listKafkaAcls")
11+
@summary("listKafkaAcls")
1212
@get
1313
@operationId("listAcls")
1414
listAcls(
@@ -20,41 +20,42 @@ interface AclApi {
2020
): KafkaAcl[];
2121

2222
@route("/csv")
23-
@doc("getAclAsCsv")
23+
@summary("getAclAsCsv")
2424
@get
2525
@operationId("getAclAsCsv")
2626
getAclAsCsv(@path clusterName: string): string;
2727

2828
@route("/csv")
29-
@doc("syncAclsCsv")
29+
@summary("syncAclsCsv")
3030
@post
3131
@operationId("syncAclsCsv")
3232
syncAclsCsv(@path clusterName: string, @body content: string): void | ApiBadRequestResponse;
3333

34-
@doc("createAcl")
3534
@post
3635
@operationId("createAcl")
36+
@summary("createAcl")
3737
createAcl(@path clusterName: string, @body acl: KafkaAcl): void | ApiBadRequestResponse;
3838

39-
@doc("deleteAcl")
39+
@summary("deleteAcl")
4040
@delete
4141
@operationId("deleteAcl")
42+
@summary("deleteAcl")
4243
deleteAcl(
4344
@path clusterName: string,
4445
@body acl: KafkaAcl,
4546
): void | ApiNotFoundResponse;
4647

4748
@route("/consumer")
48-
@doc("createConsumerAcl")
4949
@post
5050
@operationId("createConsumerAcl")
51+
@summary("createConsumerAcl")
5152
createConsumerAcl(
5253
@path clusterName: string,
5354
@body payload: CreateConsumerAcl,
5455
): void | ApiBadRequestResponse;
5556

5657
@route("/producer")
57-
@doc("createProducerAcl")
58+
@summary("createProducerAcl")
5859
@operationId("createProducerAcl")
5960
@post
6061
createProducerAcl(
@@ -63,7 +64,7 @@ interface AclApi {
6364
): void | ApiBadRequestResponse;
6465

6566
@route("/streamapp")
66-
@doc("createStreamAppAcl")
67+
@summary("createStreamAppAcl")
6768
@post
6869
@operationId("createStreamAppAcl")
6970
createStreamAppAcl(

contract-typespec/api/auth.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ using OpenAPI;
88
@tag("Authorization")
99
interface AuthorizationApi {
1010
@route("/api/authorization")
11-
@doc("Get user authorization related info")
11+
@summary("Get user authorization related info")
1212
@operationId("getUserAuthInfo")
1313
@get
1414
getUserAuthInfo(): AuthenticationInfo;
1515
}
1616

1717
@route("/login")
18-
@doc("Authenticate")
18+
@summary("Authenticate")
1919
@operationId("authenticate")
2020
@post
2121
@tag("Unmapped")

contract-typespec/api/brokers.tsp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ using OpenAPI;
1010
interface BrokersApi {
1111
@get
1212
@operationId("getBrokers")
13-
@doc("getBrokers")
13+
@summary("getBrokers")
1414
getBrokers(@path clusterName: string): Broker[];
1515

1616
@get
1717
@route("/{id}/configs")
1818
@operationId("getBrokerConfig")
19-
@doc("getBrokerConfig")
19+
@summary("getBrokerConfig")
2020
getBrokerConfig(@path clusterName: string, @path id: int32): BrokerConfig[];
2121

2222
@put
2323
@route("/{id}/configs/{name}")
2424
@operationId("updateBrokerConfigByName")
25-
@doc("updateBrokerConfigByName")
25+
@summary("updateBrokerConfigByName")
2626
updateBrokerConfigByName(
2727
@path clusterName: string,
2828
@path id: int32,
@@ -33,13 +33,13 @@ interface BrokersApi {
3333
@get
3434
@route("/{id}/metrics")
3535
@operationId("getBrokersMetrics")
36-
@doc("getBrokersMetrics")
36+
@summary("getBrokersMetrics")
3737
getBrokersMetrics(@path clusterName: string, @path id: int32): BrokerMetrics;
3838

3939
@get
4040
@route("/logdirs")
4141
@operationId("getAllBrokersLogdirs")
42-
@doc("getAllBrokersLogdirs")
42+
@summary("getAllBrokersLogdirs")
4343
getAllBrokersLogdirs(
4444
@path clusterName: string,
4545
@query broker?: int32[],
@@ -48,7 +48,7 @@ interface BrokersApi {
4848
@patch(#{implicitOptionality: true})
4949
@route("/{id}/logdirs")
5050
@operationId("updateBrokerTopicPartitionLogDir")
51-
@doc("updateBrokerTopicPartitionLogDir")
51+
@summary("updateBrokerTopicPartitionLogDir")
5252
updateBrokerTopicPartitionLogDir(
5353
@path clusterName: string,
5454
@path id: int32,

contract-typespec/api/clusters.tsp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ using OpenAPI;
1111
interface ClustersApi {
1212
@get
1313
@operationId("getClusters")
14-
@doc("getClusters")
14+
@summary("getClusters")
1515
getClusters(): Cluster[];
1616

1717
@post
1818
@route("/{clusterName}/cache")
1919
@operationId("updateClusterInfo")
20-
@doc("updateClusterInfo")
20+
@summary("updateClusterInfo")
2121
updateClusterInfo(@path clusterName: string): Cluster;
2222

2323
@get
2424
@route("/{clusterName}/metrics")
2525
@operationId("getClusterMetrics")
26-
@doc("getClusterMetrics")
26+
@summary("getClusterMetrics")
2727
getClusterMetrics(@path clusterName: string): ClusterMetrics;
2828

2929
@get
3030
@route("/{clusterName}/stats")
3131
@operationId("getClusterStats")
32-
@doc("getClusterStats")
32+
@summary("getClusterStats")
3333
getClusterStats(@path clusterName: string): ClusterStats;
3434
}
3535

contract-typespec/api/config.tsp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@ using TypeSpec.Http;
77
using OpenAPI;
88

99
@route("/api/info")
10-
@doc("Gets application info")
10+
@summary("Gets application info")
1111
@get
1212
@tag("ApplicationConfig")
1313
op getApplicationInfo(): ApplicationInfo;
1414

1515
@route("/api/config")
1616
@tag("ApplicationConfig")
1717
interface ApplicationConfigApi {
18-
@doc("Gets current application configuration")
18+
@summary("Gets current application configuration")
1919
@get
2020
@operationId("getCurrentConfig")
2121
getCurrentConfig(): ApplicationConfig;
2222

2323
@put
24-
@doc("Restarts application with specified configuration")
24+
@summary("Restarts application with specified configuration")
2525
@operationId("restartWithConfig")
2626
restartWithConfig(@body config: RestartRequest): void | ApiBadRequestResponse;
2727

2828
@put
2929
@route("/validated")
30-
@doc("Restarts application with specified configuration")
30+
@summary("Restarts application with specified configuration")
3131
@operationId("validateConfig")
3232
validateConfig(@body config: ApplicationConfig): ApplicationConfigValidation | ApiBadRequestResponse;
3333

3434
@post
3535
@route("/relatedfiles")
36-
@doc("Upload config related file")
36+
@summary("Upload config related file")
3737
@operationId("uploadConfigRelatedFile")
3838
uploadConfigRelatedFile(
3939
@multipartBody body: {
@@ -43,7 +43,7 @@ interface ApplicationConfigApi {
4343

4444
@get
4545
@route("/authentication")
46-
@doc("Get authentication methods enabled for the app and other related settings")
46+
@summary("Get authentication methods enabled for the app and other related settings")
4747
@operationId("getAuthenticationSettings")
4848
getAuthenticationSettings(): AppAuthenticationSettings;
4949
}

contract-typespec/api/consumer-groups.tsp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface ConsumerGroupsApi {
1212
@get
1313
@route("/paged")
1414
@operationId("getConsumerGroupsPage")
15+
@summary("getConsumerGroupsPage")
1516
getConsumerGroupsPage(
1617
@path clusterName: string,
1718
@query page?: int32,
@@ -24,6 +25,7 @@ interface ConsumerGroupsApi {
2425
@get
2526
@route("/{id}")
2627
@operationId("getConsumerGroup")
28+
@summary("getConsumerGroup")
2729
getConsumerGroup(
2830
@path clusterName: string,
2931
@path id: string,
@@ -32,11 +34,13 @@ interface ConsumerGroupsApi {
3234
@delete
3335
@route("/{id}")
3436
@operationId("deleteConsumerGroup")
37+
@summary("deleteConsumerGroup")
3538
deleteConsumerGroup(@path clusterName: string, @path id: string): void;
3639

3740
@post
3841
@route("/{id}/offsets")
3942
@operationId("resetConsumerGroupOffsets")
43+
@summary("resetConsumerGroupOffsets")
4044
resetConsumerGroupOffsets(
4145
@path clusterName: string,
4246
@path id: string,
@@ -46,6 +50,7 @@ interface ConsumerGroupsApi {
4650
@delete
4751
@route("/{id}/topics/{topicName}")
4852
@operationId("deleteConsumerGroupOffsets")
53+
@summary("deleteConsumerGroupOffsets")
4954
deleteConsumerGroupOffsets(
5055
@path clusterName: string,
5156
@path id: string,
@@ -58,6 +63,7 @@ interface ConsumerGroupsApi {
5863
interface TopicConsumerGroupsApi {
5964
@get
6065
@operationId("getTopicConsumerGroups")
66+
@summary("getTopicConsumerGroups")
6167
getTopicConsumerGroups(
6268
@path clusterName: string,
6369
@path topicName: string,

contract-typespec/api/kafka-connect.tsp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ using OpenAPI;
1111
interface ConnectInstancesApi {
1212
@get
1313
@operationId("getConnects")
14+
@summary("getConnects")
1415
getConnects(@path clusterName: string, @query withStats?: boolean): Connect[];
1516

1617
@get
1718
@route("/{connectName}/plugins")
18-
@doc("get connector plugins")
19+
@summary("get connector plugins")
1920
@operationId("getConnectorPlugins")
2021
getConnectorPlugins(
2122
@path clusterName: string,
@@ -24,7 +25,7 @@ interface ConnectInstancesApi {
2425

2526
@put
2627
@route("/{connectName}/plugins/{pluginName}/config/validate")
27-
@doc("validate connector plugin configuration")
28+
@summary("validate connector plugin configuration")
2829
@operationId("validateConnectorPluginConfig")
2930
validateConnectorPluginConfig(
3031
@path clusterName: string,
@@ -40,6 +41,7 @@ interface ConnectInstancesApi {
4041
interface ConnectorsApi {
4142
@get
4243
@operationId("getAllConnectors")
44+
@summary("getAllConnectors")
4345
getAllConnectors(
4446
@path clusterName: string,
4547
@query search?: string,
@@ -54,10 +56,12 @@ interface ConnectorsApi {
5456
interface KafkaConnectConnectorsApi {
5557
@get
5658
@operationId("getConnectors")
59+
@summary("getConnectors")
5760
getConnectors(@path clusterName: string, @path connectName: string): string[];
5861

5962
@post
6063
@operationId("createConnector")
64+
@summary("createConnector")
6165
createConnector(
6266
@path clusterName: string,
6367
@path connectName: string,
@@ -67,6 +71,7 @@ interface KafkaConnectConnectorsApi {
6771
@get
6872
@route("/{connectorName}")
6973
@operationId("getConnector")
74+
@summary("getConnector")
7075
getConnector(
7176
@path clusterName: string,
7277
@path connectName: string,
@@ -76,6 +81,7 @@ interface KafkaConnectConnectorsApi {
7681
@delete
7782
@route("/{connectorName}")
7883
@operationId("deleteConnector")
84+
@summary("deleteConnector")
7985
deleteConnector(
8086
@path clusterName: string,
8187
@path connectName: string,
@@ -85,6 +91,7 @@ interface KafkaConnectConnectorsApi {
8591
@post
8692
@route("/{connectorName}/action/{action}")
8793
@operationId("updateConnectorState")
94+
@summary("updateConnectorState")
8895
updateConnectorState(
8996
@path clusterName: string,
9097
@path connectName: string,
@@ -95,6 +102,7 @@ interface KafkaConnectConnectorsApi {
95102
@get
96103
@route("/{connectorName}/config")
97104
@operationId("getConnectorConfig")
105+
@summary("getConnectorConfig")
98106
getConnectorConfig(
99107
@path clusterName: string,
100108
@path connectName: string,
@@ -104,6 +112,7 @@ interface KafkaConnectConnectorsApi {
104112
@put
105113
@route("/{connectorName}/config")
106114
@operationId("setConnectorConfig")
115+
@summary("setConnectorConfig")
107116
setConnectorConfig(
108117
@path clusterName: string,
109118
@path connectName: string,
@@ -114,6 +123,7 @@ interface KafkaConnectConnectorsApi {
114123
@get
115124
@route("/{connectorName}/tasks")
116125
@operationId("getConnectorTasks")
126+
@summary("getConnectorTasks")
117127
getConnectorTasks(
118128
@path clusterName: string,
119129
@path connectName: string,
@@ -123,6 +133,7 @@ interface KafkaConnectConnectorsApi {
123133
@post
124134
@route("/{connectorName}/tasks/{taskId}/action/restart")
125135
@operationId("restartConnectorTask")
136+
@summary("restartConnectorTask")
126137
restartConnectorTask(
127138
@path clusterName: string,
128139
@path connectName: string,
@@ -133,6 +144,7 @@ interface KafkaConnectConnectorsApi {
133144
@delete
134145
@route("/{connectorName}/offsets")
135146
@operationId("resetConnectorOffsets")
147+
@summary("resetConnectorOffsets")
136148
resetConnectorOffsets(
137149
@path clusterName: string,
138150
@path connectName: string,

contract-typespec/api/ksql.tsp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface KsqlApi {
1212
@post
1313
@route("/v2")
1414
@operationId("executeKsql")
15+
@summary("executeKsql")
1516
executeKsql(
1617
@path clusterName: string,
1718
@body command: KsqlCommandV2,
@@ -20,16 +21,19 @@ interface KsqlApi {
2021
@get
2122
@route("/tables")
2223
@operationId("listTables")
24+
@summary("listTables")
2325
listTables(@path clusterName: string): KsqlTableDescription[];
2426

2527
@get
2628
@route("/streams")
2729
@operationId("listStreams")
30+
@summary("listStreams")
2831
listStreams(@path clusterName: string): KsqlStreamDescription[];
2932

3033
@get
3134
@route("/response")
3235
@operationId("openKsqlResponsePipe")
36+
@summary("openKsqlResponsePipe")
3337
openKsqlResponsePipe(
3438
@path clusterName: string,
3539
@query pipeId: string,

0 commit comments

Comments
 (0)